Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent notifications for blocked users #13689

Merged

Conversation

arpi-tremend
Copy link
Contributor

@arpi-tremend arpi-tremend commented Nov 20, 2024

Prevent sending notifications to blocked users

📌 Related Issues

Testing

Previous conditions for "User X"

  • User X has all notifications activated in realtime
  • User X follows the activity of the participation space “A”

Steps to follow as a site administrator:

  • Publish a content in space "A" and check if user X receive the notification. (He received. OK)
  • Block User X
  • Publish a content in space "A" and check if user X receive the notification. (He received. NOT OK)

Expected behavior:

  • Blocked users shouldn't receive any email notification (except block/unblock message)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: ['type: feature', 'type: change', 'type: fix', 'type: removal', 'target: developer-experience', 'type: internal']

@alecslupu alecslupu added the type: fix PRs that implement a fix for a bug label Nov 21, 2024
github-actions[bot]
github-actions bot previously approved these changes Nov 21, 2024
@alecslupu alecslupu self-assigned this Nov 21, 2024
github-actions[bot]
github-actions bot previously approved these changes Nov 21, 2024
github-actions[bot]
github-actions bot previously approved these changes Nov 22, 2024
github-actions[bot]
github-actions bot previously approved these changes Dec 18, 2024
github-actions[bot]
github-actions bot previously approved these changes Dec 18, 2024
github-actions[bot]
github-actions bot previously approved these changes Dec 18, 2024
alecslupu
alecslupu previously approved these changes Dec 18, 2024
Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alecslupu alecslupu assigned andreslucena and unassigned alecslupu Dec 18, 2024
github-actions[bot]
github-actions bot previously approved these changes Dec 18, 2024
@alecslupu alecslupu added release: v0.28 Issues or PRs that need to be tackled for v0.28 release: v0.29 labels Dec 18, 2024
decidim-core/lib/tasks/upgrade/clean.rake Show resolved Hide resolved
RELEASE_NOTES.md Outdated Show resolved Hide resolved
RELEASE_NOTES.md Outdated Show resolved Hide resolved
RELEASE_NOTES.md Outdated Show resolved Hide resolved
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading it again it was what I had in mind. Thanks for the PR!

Also I realized that we have the same problem with deleted users:

  1. Sign in as "user@example.org"
  2. Check that I have the notifications sending frequency set to "daily"
  3. Delete my account
  4. Open a rails console and run "Decidim::User.where.not(deleted_at: nil).first.notifications_sending_frequency". See that it's daily

@alecslupu can you open another PR to fix this related bug? As I think we should handle that in another PR, I'll merge this as is. Thanks

@andreslucena andreslucena merged commit 7ac8c00 into decidim:develop Jan 7, 2025
109 checks passed
@alecslupu alecslupu deleted the fix/blocked-user-notification branch January 7, 2025 10:42
@alecslupu alecslupu added release: v0.28 Issues or PRs that need to be tackled for v0.28 and removed release: v0.28 Issues or PRs that need to be tackled for v0.28 labels Jan 8, 2025
mllocs pushed a commit that referenced this pull request Jan 9, 2025
* Block notifications for blocked users

* Add tests for fix_blocked_user_notification task

* Remove trailing whitespaces

* Update RELEASE_NOTES.md

* Update decidim-core/lib/tasks/upgrade/clean.rake

* RELEASE_NOTES.md lint fix

* Remove line 24 from RELEASE_NOTES.md

* Apply suggestions from code review

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

---------

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: admin module: core release: v0.28 Issues or PRs that need to be tackled for v0.28 release: v0.29 type: fix PRs that implement a fix for a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Blocked users still receive notifications of site activity
3 participants