Attach the options listeners before reading storage - #831
Merged
Merged
Conversation
The options page opened by reading chrome.storage.sync, and only wired up its inputs once that resolved. `load` fires when the script starts, not when the read lands, so a change arriving in that window reached no listener and was dropped in silence -- the field kept a value the page had already decided to reject, with nothing said. Too narrow for a person to hit by typing, wide enough for a test: the browser suite failed on it the first time it ran on a runner with different timing. Listeners now attach synchronously and the stored values fill in afterwards. A change in the window before hydration reverts to an empty field rather than the stored address, which is what the field already shows at that instant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
The extension options page opened with
await chrome.storage.sync.get("instance")and only wired up its inputs once that resolved.loadfires when the script starts, not when that read lands, so achangearriving in between reached no listener and was dropped in silence -- the field kept a value the page had already decided to reject, with nothing said.Too narrow for a person to hit by typing. Wide enough for a test:
extension-popup.spec.ts:47failed on it the first time the suite ran on a GitHub-hosted runner (#830), waiting 5s for arole="alert"that never got its text.Listeners now attach synchronously; the stored values fill in afterwards. A change in the window before hydration reverts the field to empty rather than to the stored address -- which is what the field already shows at that instant, so nothing visible changes.
Verified locally: all 3 specs in
extension-popup.spec.tspass.🤖 Generated with Claude Code