Skip to content

fix: ignore a widget's request to present the page again before Leaf mounts - #7024

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7019
Nov 24, 2026
Merged

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

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Since #6920, Leaf drives any custom element whose tag declares verbs or inputs from early in boot (hostDeclaredElements in browser/leaf.js), well before mountApplication. A widget whose class a page's own script defines, as the published-capture journey's lf-options is, can finish its first draw in that gap. Its widgetMounted call then reached the application facade's invalidateDom, which threw Leaf application has not been mounted, and the render harness's error collector failed the page. Any page that defines a declared widget in its own script would fail page check --render the same way.

Before the mount no document-wide presenter is registered, and each presents the document as it then stands once the mount registers it, so a request to present the page again has nothing to reach. The facade's invalidateDom now resolves without work until the application exists. An lf-defer hold that ends before the mount reaches the same facade and gets the same answer.

Both cases of tests/journeys/test_live_shell_artifact.py::test_a_browser_executes_the_published_capture_with_live_api_routes ([False] from source modules, [True] bundled) errored at teardown on main and pass with the change. pnpm run check:browser, pnpm run test:runtime (1115 pass) and the state/record cases in tests/browser/test_plain_elements.py pass. journeys/ doesn't run on pull requests, so this PR's CI won't run the fixed test.

Closes #7019 — automated triage

…mounts

Since #6920 Leaf drives a plain custom element from early in boot, so a
widget a page's own script defines can finish its first draw before
mountApplication runs. Its widgetMounted call then reached the
application facade's invalidateDom, which threw 'Leaf application has
not been mounted', and the render check failed the page. Before the
mount no document-wide presenter exists, and each presents the document
as it stands once the mount registers it, so the facade now resolves
the request without work.

Fixes both cases of
test_a_browser_executes_the_published_capture_with_live_api_routes.

Closes #7019
@leaf-agent
leaf-agent merged commit 14ed095 into main Nov 24, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7019 branch November 24, 2026 17:35
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_a_browser_executes_the_published_capture_with_live_api_routes: application not mounted at teardown since #6920

1 participant