Skip to content

test: open the latest revision without moving the caret in the held-read test - #6648

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6598
Nov 21, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6598

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_an_old_document_state_request_cannot_update_the_new_revision failed on macOS because the page installed revision 2 by itself while the test had the leaf's menu open, before it pressed Open latest. The test relied on its page-comment draft to keep revision 1 shown. Opening the menu moves focus to the menu's search, so the draft stops holding (midComposition holds only for a focused box). The next heartbeat (every 2 s, state-feed.js) then installs revision 2 by a fresh document, which takes the panel away. panel_settled's predicate then read the missing panel host and threw. The failing run's page picture shows "Live second", with the draft carried over and the menu gone.

The test now presses Open latest through open_latest, which runs the same versionPicker.latest() as the menu's row without moving the caret. It also drops expect_panel_offers(page, "latest"), which opened the menu the same way. What the test protects is unchanged: a state read held from the old realm doesn't update the new revision.

Evidence

  • Before: a scratch test that held the menu open for 4.5 s after the same setup read "Live second" every time. That is a deterministic reproduction of the macOS failure.
  • After: the edited test passes locally. With a temporary 4.5 s pause before Open latest, it still reads "Live first" at the end of the pause and passes.
  • Still to come: the dispatch in test_an_old_document_state_request_cannot_update_the_new_revision: panel_settled reads a null panel host on macOS #6598 didn't reproduce the failure in 18 copies on CI's Mac. So, as running-tend allows, the failing scheduled run counts as the before, and the next scheduled test-macos run after merge as the after.

Contract correction. version.js still said an open menu defers an install. That check (versionMenuIsOpen) went with the classic chrome in #3100, and nothing defers an install while the floating panel's menu is open. The header and prepareActivation's comment now describe the current code. A user with the leaf's menu open when a revision with changed executable inputs lands still sees the page reload and the menu close; only an open thread is carried across. Making an open menu defer installs again would add a hold to the core runtime for a rare path. That is a product call this PR leaves open.

Closes #6598 — automated triage

…ead test

test_an_old_document_state_request_cannot_update_the_new_revision relied on a
page-comment draft to keep the first revision shown while it opened the leaf's
menu to press Open latest. Opening the menu moves focus to the menu's search, so
the draft no longer holds (composing/engagement.js, `midComposition`), and a
heartbeat that falls while the menu stands (state-feed.js, every 2 s) installs
the second revision by a fresh document, which takes the menu away. On a slow
macOS runner the panel host vanished under `panel_settled`, whose predicate then
read a null node.

The test now opens the latest through `open_latest`, which runs the same
`versionPicker.latest()` as the menu's row and leaves the caret in the draft, and
drops the menu premise check that opened the menu the same way. The behavior it
protects, an old realm's held state read not updating the new revision, is
unchanged.

version.js still said an open menu defers an install. That hold went with the
classic chrome's version menu (#3100), and nothing defers on the floating
panel's menu, so the header and `prepareActivation`'s comment now say what the
code does.

Closes #6598
@leaf-agent
leaf-agent merged commit 722e279 into main Nov 21, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6598 branch November 21, 2026 06:57
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.

test_an_old_document_state_request_cannot_update_the_new_revision: panel_settled reads a null panel host on macOS

1 participant