Skip to content

fix(framework): use hasOwnProperty for asyncFinished guard to prevent inherited value from skipping define() await - #14087

Merged
nnaydenow merged 2 commits into
mainfrom
define-guard
Sep 24, 2026
Merged

nnaydenow merged 2 commits into
mainfrom
define-guard

Conversation

@nnaydenow

Copy link
Copy Markdown
Contributor

A subclass with i18n bundles extending a parent without i18n bundles would incorrectly skip awaiting its own _definePromise in connectedCallback. The parent's define() finishes first and sets asyncFinished = true as an own property; the child's prototype chain lookup finds that value and bypasses the await, causing render to fire before the child's i18n bundle is loaded.

Use Object.prototype.hasOwnProperty.call(ctor, "asyncFinished") in both connectedCallback and the definePromise getter so each class only considers its own asyncFinished flag.

… inherited value from skipping define() await
@nnaydenow
nnaydenow requested review from pskelin and vladitasev and removed request for vladitasev September 24, 2026 08:34
@nnaydenow
nnaydenow deployed to netlify-preview September 24, 2026 08:34 — with GitHub Actions Active
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@nnaydenow
nnaydenow deployed to netlify-preview September 24, 2026 09:57 — with GitHub Actions Active

@vladitasev vladitasev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix is correct and minimal. Object.prototype.hasOwnProperty.call(ctor, "asyncFinished") properly scopes the check to each class's own property, preventing a subclass with i18n bundles from inheriting the parent's asyncFinished = true flag and skipping its own _definePromise await. Both call sites updated consistently. The one CI failure (Tokenizer "tests token removal") is a pre-existing flaky test unrelated to this change — re-triggered and passing on rerun.

@nnaydenow
nnaydenow merged commit 119c2e0 into main Sep 24, 2026
20 of 21 checks passed
@nnaydenow
nnaydenow deleted the define-guard branch September 24, 2026 13:41
@nnaydenow
nnaydenow deployed to netlify-preview September 24, 2026 13:41 — with GitHub Actions Active
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

🧹 Preview deployment cleaned up: https://pr-14087--ui5-webcomponents.netlify.app

This branch was successfully deployed

1 active deployment
netlify-preview — 62f219bc Deployed Sep 24, 2026 by nnaydenow via cleanup-preview #680
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.

2 participants