Repository navigation
fix: ignore a widget's request to present the page again before Leaf mounts - #7024
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #6920, Leaf drives any custom element whose tag declares
verbsorinputsfrom early in boot (hostDeclaredElementsinbrowser/leaf.js), well beforemountApplication. A widget whose class a page's own script defines, as the published-capture journey'slf-optionsis, can finish its first draw in that gap. ItswidgetMountedcall then reached the application facade'sinvalidateDom, which threwLeaf 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 failpage check --renderthe 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
invalidateDomnow resolves without work until the application exists. Anlf-deferhold 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 onmainand pass with the change.pnpm run check:browser,pnpm run test:runtime(1115 pass) and thestate/recordcases intests/browser/test_plain_elements.pypass.journeys/doesn't run on pull requests, so this PR's CI won't run the fixed test.Closes #7019 — automated triage