Skip to content

Comments

fix(notifications): don't notify users about their own actions#7661

Open
ramteid wants to merge 1 commit intonextcloud:mainfrom
ramteid:bugfix/no-self-notification
Open

fix(notifications): don't notify users about their own actions#7661
ramteid wants to merge 1 commit intonextcloud:mainfrom
ramteid:bugfix/no-self-notification

Conversation

@ramteid
Copy link

@ramteid ramteid commented Feb 19, 2026

Users were receiving notifications for Action and incorrectly rendered activity entries they performed themselves, such as commenting on cards or sharing boards. The causes:

1. NotificationHelper: sendMention() and sendBoardShared() did not filter out the acting user from notification recipients.

  • sendMention: skip mentions where the mentioned user is the comment author (currentUser)
  • sendBoardShared (user type): only call notify() when participant differs from currentUser; markProcessed still runs unconditionally to clean up any pre-existing stale notifications on unshare

2. DeckProvider: $ownActivity was computed from $event->getAuthor() before the real author was resolved. For comment events, ActivityManager overrides the author to DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED, so $ownActivity was always false for comments. This caused activity entries to show "{user} commented" instead of "You commented". Moved the check after the author fallback resolution.

Summary

Three fixes:

  1. sendMention(): Skip the mention when $mention['id'] === $this->currentUser.
  2. sendBoardShared() (user type): Replace else with elseif ($acl->getParticipant() !== $this->currentUser) so that notify() is suppressed for the actor, while markProcessed() (used on unshare) still runs to clean up stale notifications.
  3. DeckProvider::parse(): Move $ownActivity computation after the author fallback resolution so it compares against the real user ID, not DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

@ramteid ramteid force-pushed the bugfix/no-self-notification branch 4 times, most recently from d00d87b to 9ef5423 Compare February 19, 2026 21:01
Users were receiving notifications for actions they performed themselves,
such as commenting on cards or sharing boards. Two root causes:

1. NotificationHelper: sendMention() and sendBoardShared() did not filter
   out the acting user from notification recipients.

   - sendMention: skip mentions where the mentioned user is the comment
     author (currentUser)
   - sendBoardShared (user type): only call notify() when participant
     differs from currentUser; markProcessed still runs unconditionally
     to clean up any pre-existing stale notifications on unshare

2. DeckProvider: $ownActivity was computed from $event->getAuthor()
   before the real author was resolved. For comments, the author is
   overridden to DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED in
   ActivityManager, so $ownActivity was always false. Moved the check
   after the author fallback resolution.

Note: sendCardAssigned already had the self-check in AssignmentService.

Signed-off-by: ramteid <ramteid@users.noreply.github.com>
@ramteid ramteid force-pushed the bugfix/no-self-notification branch from 9ef5423 to 2ce63db Compare February 19, 2026 21:23
@ramteid
Copy link
Author

ramteid commented Feb 20, 2026

This PR complements or replaces #7639, I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant