WGLMakie: fix a DOM-mount race in three_display, add AwaitedNode - #5716
Draft
bjarthur wants to merge 2 commits into
Draft
WGLMakie: fix a DOM-mount race in three_display, add AwaitedNode#5716bjarthur wants to merge 2 commits into
bjarthur wants to merge 2 commits into
Conversation
Interpolating a DOM node into `js"..."` compiled to a one-shot `document.querySelector(...)` with no retry, unlike `Scene` interpolation which already retries. On a slow/cold first page load, the JS module could finish loading before Bonito had actually mounted `wrapper`/`canvas`, silently returning null and failing scene initialization with no error on the Julia side. AwaitedNode wraps a node and retries the lookup with the same WGLMAKIE_SCENE_RETRY_* configuration already used for Scene lookups. three_display now awaits wrapper/canvas the same way it awaits the scene. Co-Authored-By: Claude Sonnet 5 <[email protected]>
5 tasks
Contributor
Author
|
this actually didn't fix the race condition problem in #5715, but claude thinks it's a good hardening measure anyway. i'll leave it as a draft for the maintainers to consider. |
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.
Description
Nodeintojs"..."(used forthree_display'swrapper/canvas) compiled to a one-shotdocument.querySelector(...)with no retry — unlikeSceneinterpolation, which already retries via a configurable window (WGLMakie: make scene lookup retry window configurable #5693). On a slow/cold first page load (fresh browser tab, first WGLMakie display in a process), the JS module could finish loading before Bonito had actually mounted that specific node, silently queryingnulland failing scene initialization insidesetup_scene_init's owntry/catch— with no error surfacing on the Julia side.AwaitedNode, wrapping a node so its lookup retries until the node is mounted, reusing the sameWGLMAKIE_SCENE_RETRY_DELAY_MS/WGLMAKIE_SCENE_RETRY_TOTAL_MSenv vars already used forScenelookups.three_displaynow awaitswrapper/canvasalongside the JS module, instead of interpolating them directly.Type of change
Delete options that do not apply:
Checklist