Repository navigation
feat(streak): one-tap reminder opt-out from the push - #7375
Conversation
/notifications/streak-reminder/off is the target of the "Turn off streak reminders" button on the streak pushes. For a signed-in reader it removes the streak_reminder digest row, as the settings switch does, and also mutes the in-app streak_reminder flag so no path sends another one, then toasts and lands on /settings/notifications where the same row turns it back on. A signed-out reader goes through the usual protected-page login with after_auth pointing back at the link. The mute waits for both the reminder row and the notification flags to load, since the flags mutation replaces the whole set from client state. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rebelchris
left a comment
There was a problem hiding this comment.
Reviewed together with dailydotdev/daily-api#4607/#4608/#4609 and the iOS click handler PR.
Deploy order: the description treats this as following daily-api#4609, but it should go first. This page only uses the existing unsubscribePersonalizedDigest and notification-settings mutations, so it works today. #4609, on the other hand, adds the button to every streak reminder (it has no flag) and links here. If #4609 lands first, the button lands on a 404.
One inline finding.
Reviewed by AI.
| extra: toggleLogExtra, | ||
| }); | ||
|
|
||
| if (notificationSettings && !isMuted) { |
There was a problem hiding this comment.
Non-blocking: setNotificationStatus isn't awaited and its failure is never surfaced. The settings mutation rolls back onError silently, while the page toasts "Streak reminders are off" anyway.
The mute is also a second source of truth for the same decision. unsubscribePersonalizedDigest already deletes the row and stamps streakReminderOptOutAt, which keeps streakReminderDefaultOn from recreating it, and the #4608 saver uses the same row. Leaving inApp muted makes a later re-enable path inconsistent. For example, toggleStreakReminderWithStreak(true) in SettingsContext (hide then show streaks) recreates the row but never unmutes, so the API skips every send and Settings shows the reminder as off.
Suggestion: drop the mute and rely on the row delete, like the settings switch does. If the mute is kept, await it and unmute in toggleStreakReminderWithStreak as well.
Reviewed by AI.
There was a problem hiding this comment.
Dropped the mute in ea94f5c. turnOffStreakReminder now only calls unsubscribePersonalizedDigest, same as the settings switch, and isReady no longer waits on the notification flags. That mutation is mutateAsync, so the page only shows the success toast once it resolves; on failure it shows the error toast and skips the opt-out event. The spec no longer expects the settings mutation and adds a failure case.
The one-tap opt-out now only deletes the reminder row, like the settings switch. The API stamps the opt-out so the row is not recreated, and the mute was a second source of truth that a later re-enable never cleared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…opt-out # Conflicts: # packages/shared/src/lib/log.ts
Changes
/notifications/streak-reminder/off, opened by the push button from dailydotdev/daily-api#4609.unsubscribePersonalizedDigestcall as the settings switch), toasts "Streak reminders are off. You can turn them back on in Settings." and goes to/settings/notifications. If the call fails it toasts an error and still goes to settings.useStreakRemindergainsturnOffStreakReminderandisReady.Deploy order
Events
Experiment
No.
Manual Testing
Specs: new
StreakReminderOffPage.spec.tsx,AccountNotificationsPage.Preview domain
https://feat-streak-reminder-opt-out.preview.app.daily.dev
🤖 Generated with Claude Code