feat: claim status notifications with permission UX, polling backoff, and SSE - #256
Merged
jhayniffy merged 2 commits intoMar 28, 2026
Merged
Conversation
… and SSE - Add useNotificationPermission: one-time prompt, localStorage denial memory, no nag loops across sessions - Add useClaimWatcher: polls /api/claims/status with exponential backoff (base 15s, cap 60s), pauses on Page Visibility hidden, battery-conscious - Update useNotifications: privacy-safe lock-screen copy, in-app toast fallback, per-claim mute/snooze controls, useClaimStatusNotifications hook - Add NotificationPermissionBanner: value-prop explanation, single ask, ClaimNotificationsToggle for full feature disable via settings - Wire ClaimsBoard to banner, toggle, watcher, and status-change notifications - Backend: GET /api/claims/status (polling) and GET /api/claims/status/stream (SSE with heartbeat) endpoints; in-process pub/sub with Redis note - Add docs/claim-notification-latency.md: latency budget, SLO (2 min), battery impact, indexer lag, multi-instance deployment guidance
|
@darcszn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94
Summary
Implements optional browser notifications and in-app toasts for claim status changes on watched claims.
Changes
Frontend
useNotificationPermission.tsuseClaimWatcher.ts/api/claims/statuswith exponential backoff (base 15 s, cap 60 s); pauses when tab is hidden (Page Visibility API); resumes immediately on tab focususeNotifications.tsmute()/snooze()controls; newuseClaimStatusNotificationshookNotificationPermissionBanner.tsxClaimNotificationsTogglefor full feature disableClaimsBoard.tsxBackend
claims.controller.tsGET /api/claims/status(polling, throttled 30 req/min);GET /api/claims/status/stream(SSE with 25 s heartbeat, throttled 5 conn/min)claims.service.tsgetClaimStatuses(),subscribeToStatusChanges(),publishStatusChange()(static, call from indexer/queue)Docs
docs/claim-notification-latency.md— latency budget table, agreed SLO, battery impact, indexer lag, multi-instance noteAcceptance Criteria
ClaimNotificationsToggleNotes
ClaimsService.statusListenerswith a Redis pub/sub channel (noted in code and docs).ClaimsService.publishStatusChange()is the integration point for the indexer — call it whenever a claim status changes in the DB.