mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 17:41:25 -08:00
On SW restart the in-memory sessions Map is empty. Previously the fetch handler fell through to requestSessionWithTimeout (3 s race window), so all simultaneous thumbnail loads during that window 401'd. Changes: - Populate preloadedSession from Cache Storage in the activate handler so media fetches get immediate auth before the first live setSession arrives from the page. - Include preloadedSession in the byBaseUrl fast path so the synchronous branch handles the burst of thumbnail requests without waiting at all. - Clear preloadedSession as soon as any real setSession arrives so stale tokens cannot linger. - Handle empty clientId (uncontrolled-context fetches) by falling through to byBaseUrl / preloadedSession / loadPersistedSession instead of doing a bare return that bypassed respondWith and caused an unauthenticated request.