fix(ui5-date-picker): guard languageAware renders against in-flight language changes#13840
Open
nnaydenow wants to merge 1 commit into
Open
fix(ui5-date-picker): guard languageAware renders against in-flight language changes#13840nnaydenow wants to merge 1 commit into
nnaydenow wants to merge 1 commit into
Conversation
nnaydenow
had a problem deploying
to
netlify-preview
July 17, 2026 14:08 — with
GitHub Actions
Failure
nnaydenow
temporarily deployed
to
netlify-preview
July 17, 2026 14:18 — with
GitHub Actions
Inactive
nnaydenow
force-pushed
the
fix/cldr-locale-data-cache-poisoning
branch
from
July 17, 2026 14:19
6ec8c94 to
882eaec
Compare
nnaydenow
temporarily deployed
to
netlify-preview
July 17, 2026 14:19 — with
GitHub Actions
Inactive
…anguage changes
When setLanguage() is called without await, CLDR data is fetched asynchronously.
Components already queued for rendering (via renderDeferred) before the language
change fires could still enter onBeforeRendering / onAfterRendering while
localeDataMap is empty, causing:
TypeError: Cannot read properties of undefined (reading 'ca-gregorian')
Two changes:
1. UI5Element._render(): skip the render for languageAware components while
getLanguageChangePending() is non-null. _invalidate() already suppresses new
invalidations during this window, but components queued before the language
change started could still reach _render(). This guard closes that gap —
reRenderAllUI5Elements({ languageAware: true }) re-renders them once CLDR
and i18n data are ready.
2. getCachedLocaleDataInstance: attach a language-change listener that clears
the LocaleData cache. This ensures that after a language change, the next
call creates a fresh LocaleData instance backed by the newly loaded CLDR
data rather than reusing a stale one from the previous locale.
Also unskips the DatePicker Cypress test suite (marked skip due to this bug)
and updates setLanguage() calls in DatePicker and DateRangePicker Cypress specs
to use explicit return inside .then() so Cypress correctly awaits the promise.
nnaydenow
force-pushed
the
fix/cldr-locale-data-cache-poisoning
branch
from
July 17, 2026 14:20
882eaec to
c926998
Compare
nnaydenow
temporarily deployed
to
netlify-preview
July 17, 2026 14:20 — with
GitHub Actions
Inactive
|
🚀 Deployed on https://pr-13840--ui5-webcomponents-preview.netlify.app |
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.
Problem
When
setLanguage()is called withoutawait, CLDR data is fetched asynchronously. Components already queued for rendering (viarenderDeferred) before the language change fires can still enteronBeforeRendering/onAfterRenderingwhilelocaleDataMapis empty, causing:_invalidate()already suppresses new invalidations during a language change forlanguageAwarecomponents, but components that were already sitting in the deferred render queue beforesetLanguage()was called could still reach_render()and execute their lifecycle hooks.Fix
UI5Element._render()— skip the render entirely forlanguageAwarecomponents whilegetLanguageChangePending()is non-null.reRenderAllUI5Elements({ languageAware: true })re-renders them once CLDR and i18n data are ready.Test changes
DatePickerCypress test suite (was marked.skipdue to this bug)setLanguage()calls inDatePickerandDateRangePickerCypress specs to use explicitreturninside.then()so Cypress correctly awaits the resolved promise before proceeding