fix(notifications): show error toast when notification snooze or un-snooze fails#8955
Conversation
When snoozeNotification or unSnoozeNotification throws, the catch blocks only call console.error — silently swallowing the error from the user's perspective. The success path already uses setToast to give feedback, so failures should do the same. Add error-level setToast calls in both catch blocks so the user knows the action did not complete.
|
evan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughError toast notifications are now displayed when snooze and unsnooze operations fail, providing user feedback in addition to existing console error logging. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Problem
NotificationItemSnoozeOptionshows a success toast whensnoozeNotificationorunSnoozeNotificationsucceeds, but the catch blocks only callconsole.error— silently swallowing the failure from the user's perspective. The user clicks the snooze option, nothing visible happens, and they have no idea whether the action succeeded or failed.This is an inconsistency: the happy path gives explicit feedback via
setToast, but the error path provides none.Fix
Add
setToastcalls withTOAST_TYPE.ERRORin both catch blocks, mirroring the pattern already used on success. The user now receives visible feedback when snooze or un-snooze fails, instead of silently being left in an unknown state.Files Changed
apps/web/core/components/workspace-notifications/sidebar/notification-card/options/snooze/root.tsxSummary by CodeRabbit