Skip to content

test(browser): wait out an element swap, look again for a new window, and report a long press that lifts nothing - #4448

Merged
devswha merged 1 commit into
mainfrom
test/browser-flaky-waits
Nov 21, 2026
Merged

devswha merged 1 commit into
mainfrom
test/browser-flaky-waits

Conversation

@devswha

@devswha devswha commented Nov 21, 2026

Copy link
Copy Markdown
Owner

What

Three changes to browser scripts, none to the product.

1. scripts/ui-regression.ts: AssertionError: .chat-transcript

A flaky pass that fails the ui-regression job, since the script is not quarantined: three times in #4026's table for 2026-11-20/21, and again in run 44934012378 (#4426).

  • Cause. After the reload, pane A's chat is first drawn as the empty list, whose container is .chat-transcript. Pane A has no conversation, so its first answer takes that element out of the page and puts the notice's own .chat-transcript in. laneColumn() waited for the selector and then read its box: a read that fell between the two got the removed element's box, null.
  • Shown. With pane A's conversation request held, the first transcript's handle was taken, the request released and the notice awaited: the handle was div.legend-list-content-container.chat-transcript, no longer connected, its box null, and the page's .chat-transcript was another element.
  • Fix. The check waits for .chat-unavailable-reason before it measures; nothing on this path replaces the transcript after it. A person sees an empty column, then the notice: nothing is wrong in the app.

2. scripts/notification-startup-regression.ts: line 105 waited 30 s

Once, in run 44896262146 (as part of ui-contexts-regression).

  • Cause. The script's stand-in for openWindow looked for the new page among the worker's clients once and threw when it was not there. A page that has just committed can be missing from clients.matchAll for a moment (the browser's own openWindow waits for it; the stand-in did not). The throw was reported to nobody, so the driver page waited for an answer that never came.
  • Shown. Sending the lookup before the page is opened makes main's script fail the same way every time (30 s, no message); with this change it passes in about a second.
  • Fix. The stand-in looks again every 25 ms for up to 10 s, and when it gives up, or holds no pending call, it posts probe-error with the windows it saw; the script fails at once on such a message.
  • Not the cause: the Bun.serve() timed out a request after 10 seconds warning in that log. With the app's script held 13 s the unchanged check still passes, so the proxy keeps its default.

3. scripts/workspace-touch-reorder-demo-regression.ts: a long press that lifts nothing (#4343)

Cause unknown; quarantined until 2026-12-20. The issue's next step was a report for when the 5 s wait for the lift times out. stroke now arms a small probe before the press: what was under the finger and which overlays were open before the press and at the timeout, the lifted rows, the list's scroll position, whether the pressed row is still in the page, and each touch, cancel, context menu and list scroll in between with what it landed on. It only reads the page, and removes its listeners after every press.

Forced once (the wait pointed at a class that never exists), the error read: a long press at 133,82 lifted no row: {"point":"133,82","before":{"hit":"span.workspace-copy < div.pane-select.workspace-select < div.workspace-header","overlays":[],…},"atTimeout":{"hit":"span.droplet-title < span.droplet-text < button.droplet-card","overlays":["div.droplet(in)"],"lifted":["w1C"],…},"pressedRowStillInPage":true,"events":["4ms touchstart span.workspace-copy < …"]}. In that run the demo's droplet arrived over the pressed point about three seconds into the hold: a candidate for #4343 if it can land between stroke's dismissal and the touch, which the next real failure will say.

Validation

  • bun run check fast: passed (22,319 unit tests, typecheck, build).
  • Each script once, unforced, with the change: ui-regression.ts (53 PASS lines), ui-contexts-regression.ts (63), workspace-touch-reorder-demo-regression.ts (11), in a herdr test session of this run's own. In the PC's shared test session ui-regression.ts stopped four times at an earlier step (Tab reaches the other pane's option), with other sessions' workspaces in the palette; that is this PC's state, not CI's.
  • The experiments above used scratch copies and a temporary switch, none of them in this diff.

Refs #4343, #4026. No changelog fragment: nothing a user of the app notices.

🤖 Generated with Claude Code

… and report a long press that lifts nothing

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Expanded regression coverage for notification startup, including delayed window availability and clearer timeout diagnostics.
    • Added coverage for chat-unavailable notice transitions before composer layout checks.
    • Improved long-press reorder diagnostics by recording relevant touch, cancellation, navigation, and scrolling events.

Three regression scripts add polling, rendering waits, and failure diagnostics for notification startup, unavailable-chat rendering, and touch reorder checks.

Changes: Notification startup probe

Layer / File(s) Summary
Notification probe handling
scripts/notification-startup-regression.ts
The harness polls uncontrolled window clients for the requested URL and reports an error if no pending open exists or the lookup times out. The test checks for either a completion or a probe error, then asserts that no probe errors occurred.

Unavailable-chat UI regression

Layer / File(s) Summary
Unavailable-chat rendering wait
scripts/ui-regression.ts
The test waits for .chat-unavailable-reason before measuring the composer lane after pane A's first answer.

Touch reorder regression

Layer / File(s) Summary
Long-press probe and failure report
scripts/workspace-touch-reorder-demo-regression.ts
The test records long-press state and relevant events. If the row does not lift before the timeout, the failure includes the probe report and keeps the timeout error as its cause.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related issues

  • devswha/ovis#4026 — The issue reports the transcript assertion and notification client lookup timeout that these changes address.
  • devswha/ovis#4343 — The issue reports the long-press timeout that the added probe now diagnoses.
Merge Risk: Minimal · up to 5d69c

This change only adds waits and diagnostics to regression scripts, with no product behavior change. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names three script changes: waiting out an element swap, retrying the new-window lookup, and reporting a long press that lifts nothing. Each matches a described change in the summary and obj…
Description check Passed The description follows the template. It has a Change section that explains the three script fixes with causes and fixes, and a Validation section that lists the checks run and their results. Issue #4…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names three script changes: waiting out an element swap, retrying the new-window lookup, and reporting a long press that lifts nothing. Each matches a described change in the summary and objectives. The title is long at 20 words but it is specific and accurate.

Full details: Description check

Explanation

The description follows the template. It has a Change section that explains the three script fixes with causes and fixes, and a Validation section that lists the checks run and their results. Issue #4343 is referenced, and the description states that no changelog fragment is needed. The template asks for a linked issue for features only, which does not apply here. The description does not state whether contract tests were run, but the template only requires that for HTTP/WS changes, and this PR makes none.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e94510b and 5d69ce5.

Files selected for processing: 3

  • scripts/notification-startup-regression.ts
  • scripts/ui-regression.ts
  • scripts/workspace-touch-reorder-demo-regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@devswha
devswha merged commit 151dbd2 into main Nov 21, 2026
15 checks passed
@devswha
devswha deleted the test/browser-flaky-waits branch November 21, 2026 19:08
@devswha

devswha commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 5d69ce5e2. 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 reviewed this head.

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