fix: rollback failed notification interaction with visual warning - #3145
Conversation
Signed-off-by: Adam Setch <adam.setch@outlook.com>
f6b4c89 to
0688c10
Compare
|
@codebytere - this may help with some of the occasional random state corruption you've previously reported |
afonsojramos
left a comment
There was a problem hiding this comment.
Tested this rollback behaviour end-to-end. I think that the direction is right, and settleNotificationActions is a real improvement on its own over the old Promise.all, which meant a single 403 discarded the outcome of every other notification in a bulk action.
I did reproduce two bugs with throwaway tests on this branch, plus an accessibility regression, are inline below.
Smaller items, not worth their own threads:
cancelQueriesinonMutatewith no optimistic update. All three handlersawait queryClient.cancelQueries({ queryKey: notificationsKeys.all }), but the cache write deliberately happens inonSuccessso the exit animation has time to play. That leaves the defensive restore as the snapshot's only consumer. Cancelling an in-flight poll on every click buys little. May be worth snapshotting without cancelling, or a note on why the cancel is wanted.- Every
NotificationRowsubscribes to the whole failures map.useNotificationsreturnsuseNotificationActionFailuresStore((s) => s.failures), so a singlesetFailurere-renders every mounted row. Fine at typical inbox sizes, but a per-id selector would avoid it. - Nit:
reconcileFailedNotificationsre-declares itsfailedparam inline asArray<{ notification; error; rawError }>whenFailedNotificationAction[]is already exported frommutations.ts.
CI: the SonarCloud quality gate is red: 3.4% duplication on new code against a 3% gate. The three identical onMutate blocks are the obvious candidate; hoisting them into a shared snapshotNotifications callback should clear it.
I rebased the branch onto main and pushed, the only conflict was an import block in useNotifications.ts (main's Constants import vs this PR's extended stores import).
Signed-off-by: Adam Setch <adam.setch@outlook.com>
|
appreciate all the PR feedback, @afonsojramos. I've just pushed updates based on OpenSpec+Copilot+Sol's "best" judgement :) |
|



Issue
Fix a bug whereby a notification interaction can fail [rate limit, forbidden] leaving gitify in a broken state.
Manual or timer notification refreshes would not recover state, only a force reload of the app.
Example
Using a GitHub Enterprise Managed User (EMU) account, that has subscribed to a GitHub Cloud (OSS) issue or pull request.
This particular GitHub EMU setup has security policies which prevent API interactions via PAT with GitHub Cloud content.
This throws a
HTTP 403 Forbiddenwhen performingmark as read,mark as doneorunsubscribeinteractions.Before
before.mov
After
Notification state restored on failure [tanstack query]
Visual indicator on notification interaction buttons about reason for failure
Screen.Recording.2026-08-04.at.8.08.04.AM.mov