Skip to content

fix(notifications): notify users mentioned in card comments - #8799

Open
mPanasiewicz wants to merge 1 commit into
nextcloud:mainfrom
mPanasiewicz:fix/mention-notifications-user-type
Open

mPanasiewicz wants to merge 1 commit into
nextcloud:mainfrom
mPanasiewicz:fix/mention-notifications-user-type

Conversation

@mPanasiewicz

Copy link
Copy Markdown

Summary

Mentioning someone in a card comment creates no notification.

NotificationHelper::sendMention() skips mentions whose type is not users, but IComment::getMentions() returns user. So every user mention is skipped. This came in with #7983. The tests mocked the type as users, so they passed.

This PR compares with user and updates the test data to match what the server returns.

Fixes #8113. Fixes #8334. stable35 has the same line.

How to verify: mention another board member in a new card comment. They get a notification.

Tested:

  • the 3 testSendMention* tests fail with the new test data on the old code, and pass with the fix
  • unit suite (Nextcloud server master, SQLite, PHP 8.5): 489 tests, 7 skipped, 1 warning, the same counts as before the change
  • the same change on a live instance (Deck 1.19.0, Nextcloud 35.0.2): a mention created the notification

TODO

  • Backport to stable35

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

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Claude Code found the cause, wrote the change and this description, and ran the tests. The live check was done on our own instance.

Assisted by ClaudeCode:claude-sonnet-5-5

IComment::getMentions() returns the type "user", but sendMention()
compared it with "users" and skipped every mention.

Assisted-by: ClaudeCode:claude-sonnet-5-5
Signed-off-by: Maciej Panasiewicz <maciej@panasiewicz.pl>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deck comment mentions do not trigger notifications (users vs user) No notification on mentions anymore

2 participants