fix(idb): Handle IndexedDB errors in query cache persister gracefully#119489
Closed
billyvg wants to merge 1 commit into
Closed
fix(idb): Handle IndexedDB errors in query cache persister gracefully#119489billyvg wants to merge 1 commit into
billyvg wants to merge 1 commit into
Conversation
IndexedDB can throw DOMExceptions (ConstraintError, QuotaExceededError, etc.) in certain browsers or when storage is corrupted. Previously these would bubble up unhandled and be reported to Sentry with no stack trace, providing no actionable information. This wraps the idb-keyval operations with resilient adapters: on any failure, corrupted data is cleared and IDB persistence is disabled for the remainder of the session so the app continues functioning normally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NbPDLwEwyAJfbeFe9cpua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Sentry alert fired for
ConstraintError: A mutation operation in the transaction failed because a constraint was not satisfied.from the JavaScript platform in thecontrolenvironment. The error originated in the browser's IndexedDB subsystem on the/settings/:orgId/projects/page, captured withhandled: trueand no stack trace.The only IndexedDB-backed code in the Sentry frontend is
appQueryClient.tsx, which usesidb-keyvalto persist the React Querybootstrap-projectscache. IndexedDB can throwDOMExceptions (ConstraintError,QuotaExceededError, etc.) in certain browser conditions (Firefox, private browsing, corrupted storage). Previously these exceptions would bubble up unhandled throughPersistQueryClientProviderand get captured by Sentry with no actionable information.Changes:
idb-keyvaloperations (get,set,del) in resilient adapters that catch storage exceptionsThis prevents the error from reaching Sentry (it was noise: handled, no stack trace, single browser occurrence) and ensures the app degrades gracefully when IDB is unavailable.
Evidence / Reasoning:
handled: true, no frames in stacktraceGenerated by Claude Code