fix(notifications): abort inflight fetch on unmount (#555) - #893
Conversation
Use AbortController in useNotifications refresh/cleanup so a remount cannot apply setNotifications from a previous poll (Iris-IV#555). Co-authored-by: Cursor <cursoragent@cursor.com>
|
@TCROWN10 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! 🚀 |
|
Auto-review failed (API error). Leaving PR for human review. |
|
well executed fix. the AbortController lives in the effect, is aborted in cleanup, and the signal is threaded all the way through fetchNotifications into the actual fetch call. the decision to rethrow aborts from fetchRemoteNotifications so callers do not fall back to local data on abort (src/lib/notifications.ts:139) shows real care, and the two regression tests (unmount and wallet change) cover exactly the paths in #555. two small notes, neither blocking:
the red checks (typecheck, unit, build, lint) match the stale pre-#875 base. please rebase onto current main and confirm green, then good to merge. |
Summary
fetchNotificationson unmount/wallet change viaAbortControllerso remounts cannot callsetNotificationsafter cleanupCloses #555
Type of Change
Test plan
npm test -- --runTestsByPath src/__tests__/hooks/useNotifications.test.tsx