Skip to content

fix: notification click routing race conditions#82

Merged
GraysonCAdams merged 3 commits intomainfrom
fix/notification-click-routing
Mar 4, 2026
Merged

fix: notification click routing race conditions#82
GraysonCAdams merged 3 commits intomainfrom
fix/notification-click-routing

Conversation

@GraysonCAdams
Copy link
Collaborator

Summary

  • Fix history race condition in ActivitySheet notification clicks — history.back() from overlay cleanup was firing a popstate that immediately dismissed the newly-mounted ClipOverlay
  • Defer clipOverlaySignal to the next event-loop task so popstate settles before ClipOverlay mounts
  • Handle non-feed-page notification clicks by navigating with deep-link query params
  • Await focus() and navigate() in service worker notificationclick handler so the SW stays alive until navigation completes

Test plan

  • Tap an in-app notification from the ActivitySheet — clip overlay should open and load the clip
  • Tap a comment/reply notification — clip overlay should open with comments sheet
  • Tap a push notification while app is in background — should navigate to the correct clip
  • Tap a notification from a non-feed page (e.g. settings) — should navigate to feed with clip overlay

Defer clipOverlaySignal to the next event-loop task after ondismiss()
so the popstate from history.back() settles before ClipOverlay mounts.
Also handle non-feed-page clicks by navigating with deep-link params.
Ensures the service worker stays alive until client navigation completes,
preventing silent navigation failures on some platforms.
Use goto() directly with eslint-disable for no-navigation-without-resolve
since resolve() doesn't support query params. Keeps file under 500 lines.
@GraysonCAdams GraysonCAdams enabled auto-merge (squash) March 4, 2026 14:21
@GraysonCAdams GraysonCAdams merged commit 76639a4 into main Mar 4, 2026
18 checks passed
@GraysonCAdams GraysonCAdams deleted the fix/notification-click-routing branch March 4, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant