Skip to content

test(secret-input): keep the dropped link down until the test restores it - #4941

Merged
devswha merged 1 commit into
mainfrom
fix/secret-input-offline-race
Nov 28, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/secret-input-offline-race

Conversation

@devswha

@devswha devswha commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Why

main went red on 20fc6e7 (run 46102938431): ui-contexts-regression failed once at scripts/secret-input-regression.ts:237 (the offline password refusal banner never showed) and passed on retry, which the lane counts as a failure.

Not a #4918 mismatch: the script already expects the desktop grid to take the password. The failing attempt's client connection trace shows the race: after the test calls setOffline(true) and closes the page's sockets, the page reconnected 250 ms later and answered a probe. The server is on this device, so the client rightly ignores navigator.onLine (deviceLocal), and the only thing keeping the link down was Chromium's offline emulation, which let that loopback reconnect through. Under CI load the click and typing came after the reconnect, so offline-secret went over a live link and no banner was shown.

Change

Test only. The test's WebSocket wrapper now keeps the link down until the test restores it: once dropped, a reconnect dials ws://127.0.0.1:9/ (nothing listens), and the test restores it before setOffline(false). No product code changes.

Verification (runner image herdr-ci-runner:local)

  • Fixed script, 10 runs in a row: 10/10 pass.
  • Forced race (scratch-only edits, not in this PR): skip setOffline(true) so nothing but the test blocks the reconnect, and wait 1.5 s after the drop before typing. Original script: 2/2 fail at line 237 with the same TimeoutError as CI. Fixed script: 3/3 pass, and the refusal banner is on screen when the secret is typed.
  • With setOffline and the 1.5 s delay, fixed: 3/3 pass.
  • bun run typecheck and bun test scripts/conventions.test.ts pass.

…s it

The offline password check relied on Chromium's offline emulation alone to stop the page's loopback reconnect; under CI load a reconnect got through before the typing, so the secret was sent and no refusal banner showed. The test's WebSocket wrapper now dials a closed port until the test restores it.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1f67e56 and a5a764f.

Files selected for processing: 1

  • scripts/secret-input-regression.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@devswha
devswha merged commit 8803a49 into main Nov 28, 2026
15 checks passed
@devswha
devswha deleted the fix/secret-input-offline-race branch November 28, 2026 04:10
@devswha

devswha commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head a5a764f32. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

Test-only fix for main's red ui-contexts-regression flake (secret-input-regression.ts:237). Reviews: omo gate CLEAR at a5a764f (dori review); CodeRabbit skipped this head. Verified in herdr-ci-runner:local: fixed 10/10; forced race original 2/2 fail, fixed 3/3 pass. Merged by lane main-red-secret-input on the brief's word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant