Skip to content

Prevent notifications for blocked users#13689

Merged
andreslucena merged 11 commits intodecidim:developfrom
i-need-another-coffee:fix/blocked-user-notification
Jan 7, 2025
Merged

Prevent notifications for blocked users#13689
andreslucena merged 11 commits intodecidim:developfrom
i-need-another-coffee:fix/blocked-user-notification

Conversation

@arpi-tremend
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
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 Issues or PRs that need to be tackled for v0.29 labels Dec 18, 2024
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Copy link
Copy Markdown
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
@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 Issues or PRs that need to be tackled for v0.29 type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Blocked users still receive notifications of site activity

3 participants