Skip to content

Owe a blur-cancelled native page the keyboard until it is shown - #487

Merged
yansfil merged 2 commits into
mainfrom
fix/flaky-311
Oct 5, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/flaky-311

Conversation

@yansfil

@yansfil yansfil commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Closes #311

Summary

area cycle native failed in 9 of 9 recorded CI failures at the same step: after a window blur cancels a native-page hold, the page never got the keyboard back when the window returned.
The host gave it back in a one-shot window.once("focus") and returned silently if the page was still hidden; the shell's sync that uncovers the page (the overlay that covered it goes away) can land after the window returns, so nothing paid it later.
The host now remembers that the page is owed the keyboard and pays it on window focus or on the page's show, whichever comes last. The @flaky tag and annotation are removed.

Review

  • 판단해 주세요: the debt ends on another page taking the keyboard, a new hold, leaving the page's Workspace, or the page closing - is that the right set (docs/BROWSER_DISPLAYS.md)?
  • 조심해서 볼 파일: desktop/src/main/browser.ts - returnTo/giveBack run on window focus and on every show(page, true); they allocate nothing and do no I/O.
  • 질문: a page shown much later by an operator click after the debt survived (hidden while away, no other focus) takes the keyboard then; I judged that harmless since the click wants it too.

Evidence

  • 확인한 것: new unit test fails on main and passes here (window returns before the page is shown: 0 focus calls vs 1); browser.test.ts 10 tests, desktop typecheck, lint and unit suite (100 passed) green.
  • 확인한 것: the failing step was identical in every logged failure (expect.poll(zoomOf(current).focused) after the window returns; 9 CI runs 2026-10-02..10-04); 2 other failures of this spec were electron.launch 180 s timeouts, not this step.
  • 확인하지 못한 것: no local native run of the spec: it is @needs-focus and posts real HID keys, which would take the operator's keyboard; the required desktop e2e step on macOS is the evidence, and it now runs this test without the quarantine.
  • 확인하지 못한 것: the desktop host log (browser.window_return, cycle_start_refused) is not in the uploaded CI artifact, so the hidden-at-return cause is shown by the deterministic unit repro and the failure step, not by a host log line. Two earlier failures were launch timeouts and stay out of scope.

…end the quarantine of the area cycle native spec

The host gave the page the keyboard in a one-shot window focus listener that returned silently when the page was still hidden. The shell's sync that uncovers the page can land after the window returns, so the page never got it back. The host now remembers the debt and pays it on the window focus or the page's show, whichever comes last.
# Conflicts:
#	desktop/src/main/browser.ts
@yansfil
yansfil merged commit 6d2df43 into main Oct 5, 2026
13 checks passed
@yansfil
yansfil deleted the fix/flaky-311 branch October 5, 2026 08:41
yansfil added a commit that referenced this pull request Oct 5, 2026
Related: #287 #311 #416 #417 (the last tagged tests, fixed or split in
#487, #489, #492)

## Summary

No e2e test carries the `@flaky` tag any more, so the machinery that ran
tagged tests apart goes.
The required web shards and the required desktop step no longer pass
`--grep-invert @flaky`, nightly's desktop suites no longer either, and
the two steps that ran tagged tests once in a step that could not fail
`verify` are deleted with the `quarantine` input of `web-e2e.yml`.
A flaky test is now handled one way only: CI retries it once,
`scripts/ci-flaky-report.py` files it with a seven-day deadline, and it
is fixed or deleted.
`docs/TESTING.md`, `CONTRIBUTING.md` and `docs/README.md` say there is
no quarantine tag or step.

Size: workflows 1,632 -> 1,584 lines, steps 169 -> 167 (`pr.yml` 548 ->
525, `web-e2e.yml` 290 -> 266, `nightly.yml` 225 -> 224).

## Review

- **조심해서 볼 파일**: `.github/workflows/web-e2e.yml` and `pr.yml` - the log
artifact now uploads on `failure()` only, since `steps.quarantine` no
longer exists; the required steps' output directories are unchanged.
- A `@flaky` tag added later would be only a label: no step excludes it
from a required lane.

## Evidence

- **확인한 것**: `git grep 'tag:.*@flaky'` on main 01a8894 finds no test;
no workflow or document references the removed steps or
`inputs.quarantine`; the three workflows parse as YAML; the script suite
passes (125 tests) and `nightly-report.test.cjs` passes (6).
- **확인하지 못한 것**: the nightly desktop suites without `--grep-invert` run
at the next scheduled nightly; this PR's own lanes run the required
steps.
yansfil added a commit that referenced this pull request Oct 5, 2026
## Summary

`desktop e2e` (macOS) is the longest job of a verify run and the last to
finish in 16 of the last 25 successful runs, so it sets the time
`verify` takes (job median 13.8 minutes).
Its `Remote mailbox over private SSH` step took 2.1 minutes of that
(median 126 s: about 57 s compiling the workspace again under the test's
feature set, about 53 s for the one test).
The macOS `@platform` web e2e job also holds a macOS runner, builds
hided and fetches the pinned Herdr, and finishes earlier (median 9.0
minutes).
This moves the lane there: `web-e2e.yml` takes a `remote-mailbox` input,
which builds the CLI (`verify-cargo.sh cli`, every binary the lane
starts) instead of `build -p hided` and runs the same nextest command
after the suite; `pr.yml` sets it for the macOS lane and drops the step
from `desktop e2e`.
The OS contract's macOS leg stays in `desktop e2e`.

## Review

- **판단해 주세요**: the lane now runs when `web-e2e-platform` is planned
instead of `desktop-e2e`. On the last 80 merged pull requests that is 62
runs instead of 59 (table below); `ci-plan.py` gets a comment that a
narrower `web-e2e-platform` rule would drop the lane.
- **판단해 주세요**: the mailbox test resolves dependency features differently
from the CLI build, so about 48 dependencies build a second variant that
the macOS web e2e cache (saved from `build -p hided`) does not hold:
about 25 s per run on this pull request's run. rust-cache saves only
when its key changes, and the key hashes `Cargo.toml` and `Cargo.lock`,
so main's first run after the next manifest change saves both builds;
until then the 25 s stays.
- **조심해서 볼 파일**: `.github/workflows/web-e2e.yml`, the reusable lane
nightly and the Linux and Windows lanes also call; with the input unset
(its default) their steps and cache keys are unchanged.

## Evidence

- **확인한 것 (plan)**: `ci-plan.py` (main, after #490) over the file lists
of the last 80 merged pull requests (#371-#492):

| | before (in `desktop-e2e`) | after (in `web-e2e-platform`) |
| --- | --- | --- |
| pull requests running the mailbox lane | 59 | 62 |
| lose it | | #462, #466, #487: only `desktop/` files, which the lane
does not read |
| gain it | | #381, #383, #429, #444, #447, #488: `web/e2e` specs tagged
`@platform` |

- **확인한 것 (catches)**: of 232 failed `pr.yml` runs since 2026-09-05, the
mailbox step failed in 2 (#409 `prd/hcoord-retire`, #456 cargo `typify`
bump); both plan every lane, so both still run it.
- **확인한 것 (before)**: medians of the last 22 successful verify runs:
`desktop e2e` 13.8 min, its mailbox step 126 s; `web e2e macos` 9.0 min
(build 88 s, End-to-end 382 s).
- **확인한 것 (after)**: this pull request's verify run
[37288613490](https://github.com/modakbul-gongbang/hide/actions/runs/37288613490)
(first commit; the second only removed a cache `key` line rust-cache
ignores next to `shared-key`):

| | before (median, n=22) | after (this run) |
| --- | --- | --- |
| `desktop e2e` | 13.8 min, mailbox step 126 s | 12.2 min, no mailbox
step (its suite step took 518 s against a 494 s median) |
| `web e2e macos` | 9.0 min | 11.3 min: CLI build 91 s (was `build -p
hided` 88 s), suite 383 s, mailbox step 128 s (compile 82 s of which
about 25 s dependency variants, test 43 s) |
| macOS job-minutes for the two | 22.8 | 23.5 |

Second run, on the squashed commit,
[37290394720](https://github.com/modakbul-gongbang/hide/actions/runs/37290394720):
`desktop e2e` 12.0 min, `web e2e macos` 12.6 min (CLI build 99 s, suite
386 s, mailbox step 170 s), `verify` 13.4 min.
The two macOS jobs now end within a minute of each other (12.0-12.6
against 13.8 and 9.0), so the macOS ceiling of a run drops by about 1.5
minutes, and by about 25 s more once the cache holds the dependency
variants.
- **확인한 것**: `python3 -m unittest discover -s scripts/tests` passes (125
tests); both workflow files parse.
- **확인하지 못한 것**: the warm steady state of the macOS web e2e job is seen
only after main's first run saves the new cache; the first pull-request
runs after merge are that measurement.
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.

Flaky desktop e2e: area cycle native spec loses the keyboard after a blur or a second cycle start

1 participant