Repository navigation
Closed
Labels
agent-readyMaintainer-approved for the Tale agent fleetbugBugperfPerformance improvementservice: platformPlatform service
Description
Summary
c90f244a9e introduced per-topic message loading in packages/ui, and 8b750caf30 wired it into the platform. Both were pushed directly to main on 2026-10-06. The loading has two defects.
A. A topic that lands after the 4 s wait leaves memoised labels in English
- What happens:
useThands out onetper language and namespace (packages/ui/src/i18n/client.tsx:120-126).- It re-renders its readers when their namespace's messages land (
:39-43), but it never replacest. - So a label computed in
useMemo(…, [t])keeps the fallback, English, after the topic lands. It stays that way until the component remounts or the language changes.
- Example: the granularity and metric options at
services/platform/app/features/analytics/usage/usage-metrics-page.tsx:107-122. Code search finds about 40 platform files with auseMemoover[t]. - Trigger: in a de, fr or de-CH session, the topic of a chunk loaded on demand takes longer than the chunk's 4 s wait (
packages/ui/src/i18n/topics.ts:168-181). It can also fail once and then be fetched again byensure(:183-198). The page then renders in English, and when the topic lands only the labels that aren't memoised switch language. - Which claim breaks:
c90f244a9esays "a late topic replaces the fallback instead of staying". - Tests:
client.test.tsx:58asserts thattstays the same across renders, and no test covers a memoised reader.
B. Loading another language once makes every later chunk wait for it
- What happens:
TopicRegistry.load(locale)adds that locale's files tofollowing(topics.ts:152-155).- Only a
languageChangedevent resetsfollowing(:162-165,:248-250).
- Trigger: the governance data-notice editor reads every language through
useLocalesLoaded(['en','de','fr']), anduseLocalesLoaded(packages/ui/src/i18n/load-locale.ts:126-149) callsloadLocalefor de and for fr. - Effect after an English session opens that editor:
- Every topic registered from then on is also fetched in de and fr (
register,topics.ts:88-93). - Every chunk loaded on demand waits for those files in
ready(:168-181, up to 4 s each). Before, it waited for nothing. - Each of those
load()calls also fetches every registered topic in that language, not just the topic the editor needs.
- Every topic registered from then on is also fetched in de and fr (
- The same leak: switch to fr, and before fr has loaded, switch back to de. No
languageChangedfires, because the shown language is still de, so fr stays followed.
Source and environment
- Commits:
mainatdac9bf2fcf46b1fd3936859eb94ecb1ce583bd22. These files are unchanged at9bd1e2015d. - How it was found: by reading the code. Nothing was run in a browser, and no benchmark was run.
Expected
- A: when a reader's namespace lands in its language, the reader sees a new
tor snapshot, so memoised labels recompute. - B:
readyandregisterfollow only the language the session shows. Reading other languages throughuseLocalesLoadeddoesn't change what later chunks fetch or wait for.
Related
#4421 covers the same loading path but a different defect: the Language menu while a catalog is loading or has failed.
Limits
Read-only post-merge review. Nothing was run.
Found in the TALE-965 post-merge review of 890de625..dac9bf2fcf (main after v0.5.74, slice 1).
Metadata
Metadata
Assignees
Labels
agent-readyMaintainer-approved for the Tale agent fleetbugBugperfPerformance improvementservice: platformPlatform service
Activity