fix(settings-store): surface localStorage quota/security errors (closes #454) - #473
Open
EVWorth wants to merge 1 commit into
Open
fix(settings-store): surface localStorage quota/security errors (closes #454)#473EVWorth wants to merge 1 commit into
EVWorth wants to merge 1 commit into
Conversation
#454) Both setQuerySettings and setFormatterSettings wrapped localStorage.setItem in a try/catch with an empty catch body — quota-exceeded writes (Chrome's 5 MB hard cap), Safari private mode, and disabled-storage environments all silently reverted user settings to defaults on next launch. No log, no signal, no degradation flag. - Add `settingsStorageError: string | null` slot to the store. Populated by both setters when persistence throws; cleared on next successful write. - Distinguish DOMException codes: QuotaExceededError (suggest clearing space), SecurityError (private mode / cookies disabled), or generic. - console.warn with the original exception so dev-tools surfaces the failure path. - Adds 3 tests: quota path, security path, recovery path on next successful write. Consumers (e.g. a future toast banner) can subscribe to the new slot to surface a user-visible error. Closes #454 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Both setQuerySettings / setFormatterSettings wrapped localStorage.setItem in try/catch with empty catch — quota-exceeded writes (Chrome's 5 MB hard cap), Safari private mode, and disabled-storage environments all silently reverted settings to defaults on next launch.
settingsStorageError: string | nullslot, populated by both setters, cleared on next successful writeconsole.warnwith the original exception so dev-tools surfaces the failure pathFiles
Test plan
Closes #454