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
{{ message }}
Repository navigation
Commit 11bd171
Browse filesBrowse the repository at this point in the historyBrowse files
[FSSDK-13343] Skip the default browser event store when localStorage is unavailable (#1184)
## Summary
- **localStorage check:** new `isLocalStorageAvailable()` in `lib/utils/env/browser.ts`. It returns `false` when reading the `localStorage` global throws (a `ReferenceError` where it isn't defined, such as SSR, or a `SecurityError` where storage is blocked, such as disabled cookies or sandboxed iframes) or when the global is `null`.
- **Browser batch event processor:** `createBatchEventProcessor` only builds its default `LocalStorageCache`-backed `EventStore` when localStorage is available. Otherwise it runs without an event store and adds a Warn startup log: `localStorage is not available, events will not be persisted.` A user-provided `eventStore` is used exactly as before, whether or not localStorage is available.
- **Startup logs from platform factories:** `getBatchEventProcessor` accepts a `startupLogs` option and puts those logs before its own, without changing the caller's array. The option is on the internal `BatchEventProcessorFactoryOptions` only; the public `BatchEventProcessorOptions` is unchanged.
Before this change, the browser factory always created a `LocalStorageCache` event store. Where localStorage can't be accessed, every store operation threw. With no event store, events are still batched and dispatched; failed events just aren't persisted for retry across page loads.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments