Skip to content

fix: await the first bound widget drawing after unread data - #4102

Closed
leaf-agent wants to merge 1 commit into
mainfrom
fix/issue-4093
Closed

leaf-agent wants to merge 1 commit into
mainfrom
fix/issue-4093

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A bound widget could report page readiness while its first drawing was still loading. Lit leaves hasUpdated false when unread data skips the initial update, so LeafElement.requestUpdate() failed to claim presentation for the first real draw. It now uses the render root Lit creates before that initial update decision to recognize subsequent requests.

The new runtime regression holds the first bound drawing open: it fails before the fix and passes afterward. Both manifest metadata variants reproduced the null shadow root before the change; all four inline/manifest and desktop/phone variants now pass with their metadata, evidence, source-path and commenting assertions intact. The four failed-patch/return checks also pass, preserving #3987's unchanged-source gate and refusal retention.

Validation: pnpm run check passes, including 562 runtime tests and 85 Worker tests. Rebuilt the committed kernel. A served worktree-diffs comparison against the base reaches upgrade and presentation with the same 53 code requests (50 JavaScript requests), 90 additional code bytes, and no layout shifts in either arm. No resource dependency is added.

Closes #4093 — automated triage

A skipped initial Lit update leaves hasUpdated false. The next request therefore failed to claim presentation, letting page readiness finish while the first source drawing still loaded deferred evidence. Use the render root Lit creates before its first update decision to distinguish later requests from its constructor request. The regression holds that first drawing open and fails before the change; all four native diff metadata variants now pass. This preserves the unchanged-source gate and refusal retention from #3987.

Closes #4093

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4103 addresses the same skipped-first-update readiness gap in LeafElement, using a fallback claim in shouldUpdate() instead of changing the requestUpdate() gate. These are alternative fixes; after one lands, the other should be reconciled against it rather than adding a second claim mechanism for the same gap.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #4103, which fixes the same skipped-first-update presentation gap and already has a standing approval. This session reproduced both manifest metadata failures in #4093 and verified that the first drawing had no presentation claim while hasUpdated remained false. I will re-run the four original metadata cases against the shared fix before closing that cause issue.

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.

Manifest diff metadata tests read a null shadow root

1 participant