You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: retry media requests once on 401 with refreshed session
There is a timing window between when the SDK refreshes its access
token (tokenRefreshFunction resolves and pushSessionToSW is called)
and when the resulting setSession postMessage is processed by the SW.
Media requests that land in this window carry the stale token and
receive 401. The browser then retries those image/video loads, hitting
the SW again with the same stale token — producing the repeated 401
bursts visible in the console.
fetchMediaWithRetry() resolves this by retrying once on 401: it
re-checks the in-memory sessions map (and preloadedSession fallback)
for a different access token. By the time the retry runs, setSession
will normally have been processed and the map will hold the new token.
Applied consistently across all four branches of the fetch handler.
0 commit comments