fix(notifications): don't notify users about their own actions#7661
Open
ramteid wants to merge 1 commit intonextcloud:mainfrom
Open
fix(notifications): don't notify users about their own actions#7661ramteid wants to merge 1 commit intonextcloud:mainfrom
ramteid wants to merge 1 commit intonextcloud:mainfrom
Conversation
d00d87b to
9ef5423
Compare
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>
9ef5423 to
2ce63db
Compare
Author
|
This PR complements or replaces #7639, I guess. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()andsendBoardShared()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 callnotify()when participant differs fromcurrentUser;markProcessedstill runs unconditionally to clean up any pre-existing stale notifications on unshare2. DeckProvider:
$ownActivitywas computed from$event->getAuthor()before the real author was resolved. For comment events,ActivityManageroverrides the author toDECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED, so$ownActivitywas alwaysfalsefor comments. This caused activity entries to show "{user} commented" instead of "You commented". Moved the check after the author fallback resolution.email notification to myself when own user comments card #6955
Own deck card actions not handled correctly #4303
Notifications to be received only upon mentions or comments made by other users #4304
in Deck comments, replies to comments with mentions results in receiving an email notification from oneself as if it was a new one #4305
No notification on own changes #2068
Comment replies to tagged members notifies the tagged member even if it's the same user reply #2672
Comments: Don't notify author himself #5437
Notification for own comments - activity categorized "By others" #7102
Notification for own changes #2310
Summary
Three fixes:
sendMention(): Skip the mention when$mention['id'] === $this->currentUser.sendBoardShared()(user type): Replaceelsewithelseif ($acl->getParticipant() !== $this->currentUser)so thatnotify()is suppressed for the actor, whilemarkProcessed()(used on unshare) still runs to clean up stale notifications.DeckProvider::parse(): Move$ownActivitycomputation after the author fallback resolution so it compares against the real user ID, notDECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED.Checklist