fix: desktop notification quick replies to thread messages posted to the main room - #41875
fix: desktop notification quick replies to thread messages posted to the main room#41875jeanfbrito wants to merge 1 commit into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🦋 Changeset detectedLatest commit: 5a2ac55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (4)
WalkthroughDesktop notification replies now include ChangesNotification reply context
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change preserves the thread identifier for desktop notification replies so responses land in the correct thread; no actionable merge-blocking risk remains beyond normal checks and review. Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…the main room The notification 'reply' handler called sendMessage without tmid even though the desktop notification payload carries it, so replies to thread notifications landed in the main room. Pass tmid through (mirroring the onclick thread-navigation pattern) and add spec coverage for the hook.
7caee68 to
5a2ac55
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Rebased onto current develop — the reply handler was migrated to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #41875 +/- ##
===========================================
+ Coverage 69.20% 69.23% +0.03%
===========================================
Files 4237 4237
Lines 167697 167785 +88
Branches 29888 29896 +8
===========================================
+ Hits 116048 116163 +115
+ Misses 46482 46456 -26
+ Partials 5167 5166 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Unrelated to this PR's change, but found while validating the Desktop side of SUP-1097 and worth a look by someone who knows this hook's history:
const notificationDuration = !requireInteraction ? (notification.duration ?? 0) - 0 || 10 : -1;
if (notificationDuration > 0) {
setTimeout(() => n.close(), notificationDuration * 1000);
}The server never sends On Windows that timer cannot do what it looks like it does: once the toast banner has slid away, the notification lives on as an Action Center card that the OS keeps repliable indefinitely, and Two things worth deciding by someone with the context:
Happy to open a separate issue if that is preferable to a comment here. |
Proposed changes (including videos or screenshots)
Replying to a desktop notification for a thread message posts the reply to the main room instead of the thread.
The server-side desktop notification payload already carries the thread id (
tmid), but the client'suseNotificationreply handler dropped it when callingsendMessage. This passes it through, using the samenotification.payload.tmidconditional the hook'sonclickhandler already uses for thread navigation. No server change needed.Also adds the first spec coverage for
useNotification— the regression slipped through thesendMessageREST migration (#40675) unnoticed because the hook had no tests:tmidin the sent messagetmidkeyIssue(s)
Internal support escalation SUP-1097 (Track B). Related Desktop-side fix: RocketChat/Rocket.Chat.Electron#3464
Steps to test or reproduce
Targeted verification:
yarn jest client/hooks/notification/useNotification.spec.ts(2/2 green), ESLint clean on changed files.Further comments
One-line behavioral change;
sendMessagealready acceptstmid(AtLeast<IMessage, '_id' | 'rid' | 'msg'>), so no typing changes. Changeset included (@rocket.chat/meteorpatch).Summary by CodeRabbit
Bug Fixes
Tests