fix(notifications): pass room and userId context to reaction notification filter#673
fix(notifications): pass room and userId context to reaction notification filter#673Just-Insane wants to merge 5 commits intoSableClient:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes reaction notifications being silently filtered out by ensuring isNotificationEvent receives the required room and userId context at both notification entry points.
Changes:
- Pass
roomandmx.getUserId() ?? undefinedintoisNotificationEventin the foreground (in-app) notification path. - Pass
roomandmx.getUserId() ?? undefinedintoisNotificationEventin the background/multi-account notification path. - Add a changeset documenting the patch-level fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/app/pages/client/ClientNonUIFeatures.tsx | Fixes foreground notification filtering by providing room/userId context to reaction filtering logic. |
| src/app/pages/client/BackgroundNotifications.tsx | Fixes background notification filtering by providing room/userId context to reaction filtering logic. |
| .changeset/reaction-notification-context.md | Documents the user-facing patch change for release notes/versioning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| if (!room || isHistoricalEvent || room.isSpaceRoom() || !isNotificationEvent(mEvent)) { | ||
| if (!room || isHistoricalEvent || room.isSpaceRoom() || !isNotificationEvent(mEvent, room, mx.getUserId() ?? undefined)) { |
There was a problem hiding this comment.
This condition line exceeds the repo’s Prettier printWidth (100) and will fail pnpm run fmt:check. Please run Prettier (or wrap the if condition across multiple lines) so formatting checks pass.
| if (!room || isHistoricalEvent || room.isSpaceRoom() || !isNotificationEvent(mEvent, room, mx.getUserId() ?? undefined)) { | |
| if ( | |
| !room || | |
| isHistoricalEvent || | |
| room.isSpaceRoom() || | |
| !isNotificationEvent(mEvent, room, mx.getUserId() ?? undefined) | |
| ) { |
| default: patch | ||
| --- | ||
|
|
||
| Fix reaction notifications not being delivered by passing room and user context to the notification event filter |
There was a problem hiding this comment.
The release-note line is over the repo’s Prettier printWidth (100) and will be reformatted/fail pnpm run fmt:check. Please wrap the summary onto multiple lines (keeping it as a single paragraph).
| Fix reaction notifications not being delivered by passing room and user context to the notification event filter | |
| Fix reaction notifications not being delivered by passing room and user | |
| context to the notification event filter |
Description
isNotificationEventinroom.tsalready has logic to only surface reaction notifications for reactions to the current user's messages — but both call sites were invoking it without the requiredroomanduserIdarguments, causing it to hit the safe-default branch that silently filters out all reactions.This change passes
roomandmx.getUserId()at both notification paths so the existing filter works as intended:BackgroundNotifications.tsx— background/multi-account notification pathClientNonUIFeatures.tsx— foreground in-app notification pathFixes #
Type of change
Checklist:
AI disclosure:
The two changed call sites were identified and modified with AI assistance. The fix passes
roomandmx.getUserId() ?? undefinedtoisNotificationEventso that the existing reaction-ownership check inroom.tsreceives the context it needs to function correctly.