Skip to content

fix: eliminate SW session race causing initial media 401s#565

Closed
Just-Insane wants to merge 1 commit intoSableClient:devfrom
Just-Insane:fix/rotate-encryption-sessions
Closed

fix: eliminate SW session race causing initial media 401s#565
Just-Insane wants to merge 1 commit intoSableClient:devfrom
Just-Insane:fix/rotate-encryption-sessions

Conversation

@Just-Insane
Copy link
Copy Markdown
Contributor

@Just-Insane Just-Insane commented Mar 28, 2026

Superseded by #548 — the SW session race fix has been merged into that PR.",

Resolve stash conflict in DevelopTools.tsx — keep the improved Rotate
Encryption Sessions description and success message text from the
stashed changes.

Add an immediate synchronous sendSessionToSW() call in index.tsx before
React mounts. When the SW is already active (normal page reload),
navigator.serviceWorker.controller is set and the postMessage is sent
before createRoot().render() runs and before any <img> elements fire
fetch events. This discards the stale preloadedSession in the SW (which
could be from a previous token that is no longer current) before the
first thumbnail/media fetches arrive, preventing the race condition that
produced 401 errors on initial load with Retry buttons.
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