gabotorresruiz commented on PR #42874: URL: https://github.com/apache/superset/pull/42874#issuecomment-5219305734
@rebenitez1802 good catch, thanks. You are right that the two paths agreed only because of `getBootstrapData`'s memoization, which is an implicit invariant rather than a guarantee. I pushed a change that snapshots the registered extras once (`extraThemeTokensCache`), so the cached valid-token set (`isValidTokenName`) and the live reads (`isSupersetCustomToken`, `getAllValidTokenNames`) now derive from the same list by construction. That removes the divergence in your second scenario, and the internal split inside `getAllValidTokenNames` where `supersetTokens` was live but total came from the frozen cache. On the first scenario (a first `isValidTokenName` call before the `#app[data-bootstrap]` DOM exists): that one is really a property of `getBootstrapData` itself, which caches `DEFAULT_BOOTSTRAP_DATA` permanently if called pre-bootstrap, so it affects every consumer rather than theme tokens specifically. `isValidTokenName` is only reachable from the theme editor, which renders well after bootstrap, so I left that alone rather than adding a reset hook here. -- 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]
