YuriyKrasilnikov commented on PR #37367: URL: https://github.com/apache/superset/pull/37367#issuecomment-4762103307
## Rebased and slimmed down Rebased on latest upstream/master and reduced this PR to the remaining ordering fix only. You were right that #36893 already covered the broader initPreamble() restructure, so I removed the separate initEmbedded.ts approach from this PR. The embedded entry already gets preamble.ts through addPreamble(), so the extra shim is no longer needed. ### Root cause The remaining issue was the non-en locale path in preamble.ts: 1. preamble.ts initializes SupersetClient 2. non-en locale triggers language-pack fetch 3. first await yields execution 4. embedded entry continues importing plugins 5. some plugin modules call isFeatureEnabled() during import/control-panel setup 6. initFeatureFlags() had not run yet For en locale this window is effectively absent because there is no language-pack fetch. ### Fix Moved initFeatureFlags() before the language-pack block, so feature flags are initialized synchronously before the first await. Added a regression test that verifies initFeatureFlags() runs before the non-English language-pack fetch. Production code diff is now only the reorder in preamble.ts plus the test update. CI is green. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
