#59 · Fix the flaky summaries bounds test (and a typed-bounds bug it exposed)
- timeline-app
- pull request
Fixes the intermittent `summaries-browser.mjs` failure (`actual: '-200/1', expected: '0'`) that has been failing Browser jobs on several PRs, most often in Firefox. **App bug (the main cause).** A bound field isn't rewritten while focused. So if the view changed during that time (e.g. an import fitting the view while the left bound had focus), the field's remembered "last shown" value went stale. After the reader typed a left bound and moved to the right field, the next render saw the mismatch and replaced the typed text. Typing now records the current view as the field's basis, so typed text waits for **Go** unless the view moves again. The test reproduces this by focusing the left bound before importing. **Test race (a rarer second cause).** In Firefox, a dialog that is still closing returns focus to its opener when it finishes. Once, the search dialog from the previous check did this while the bounds were being typed, so the text went nowhere. The search test now waits for its dialog to close, and the summaries test waits until no dialog is open before importing. **Diagnostics.** The assertion now reports the focused element, open dialogs and the exact left bound, so any recurrence in CI shows its cause. Local runs: Firefox offline went from about 1 failure in 5 runs (main) to 1 in about 43 with the app fix alone, then 0 in 20 with the test waits added. Unit, browser and offline suites pass in Chromium and Firefox.
Sources
Open #59 · Fix the flaky summaries bounds test (and a typed-bounds bug it exposed) in the timeline