Repository navigation
fix(settings): keep a setting changed back mid-save or just before a reload - #2747
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Owner
Author
|
Merge note: merged on the omo review (CLEAR at this head), Codex Terra (no HIGH; reproduced findings fixed, the rest listed in the PR comments) and green checks. CodeRabbit did not review this head (rate-limited or skipped). |
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
scripts/settings-unload-regression.ts:42timed out on PR CI (#2732, #2735). It reproduces on origin/main in isolation, so it is not only load: three causes stacked up.takePreferences): while a save was in flight, a value changed back here was measured against the old baseline, not against the change on its way. Turning a switch on, then off before the server's answer, made that answer (on) overwrite the local off. The muted panes already compared against the in-flight change; settings and pins now do too.PUT /api/preferencessent atpagehideduring a reload. A Chromium net-log of a failing run showsfetchwas called (keepalive) but no request ever reached the network stack. The unsent change is now also left insessionStorage; the reloaded tab treats each value still held as it went as its own edit and sends it again, but only when the server's revision has not moved past what the leaving page knew (a newer save from another browser wins).page.waitForFunction; the returned Promise is truthy, so it never waited. It now waits on the server's event stream for the document holding the last value (bounded 5s, no fixed sleep).Validation
takePreferencesunit test and the new hook test ("the reloaded page sends it again") fail on origin/main'spreferencesSync.tsand pass with the fix.bun test src/lib/preferencesSync.test.ts src/lib/preferencesSync.hook.test.ts: 70 pass.bun run check fast: ok (typecheck, build, 11077 unit pass).bun run check full(CI runs it).