You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix react-compiler warnings: mutations, debounce, and delete patterns in admin UI - #52904
reloadResources() does not remove keys that are missing from the newly fetched bundle; i18next merges the reload into the existing resource store. Deleting a custom realm override that is not present in the theme therefore leaves the old value cached, so t(key) can continue returning the deleted translation. Clear/replace the affected resource bundle (and reload the relevant locale) instead of relying on the reload alone.
await i18n.reloadResources();
Files reviewed: 10/10 changed files
Comments generated: 0
Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
Address eslint-plugin-react-compiler warnings across ten admin console
components by avoiding in-place mutations, using useMemo for debounced
handlers, and renaming watch values that look like hooks.
Closeskeycloak#52903
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
<
8000
div class="timeline-comment-actions flex-shrink-0 d-flex flex-items-center">
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Deleting a custom translation without a theme fallback leaves the old value available to t() until a page reload because reloadResources() merges messages instead of replacing the bundle.
addResourceBundle(..., false, true) still shallow-merges into the existing bundle (upstream default branch), so a deleted override with no theme replacement remains available to t(). Remove and rebuild the bundle with the deleted keys excluded before reloading, so the reload can restore any theme defaults.
RealmContext.tsx:41–43 loads translations under encodeURIComponent(realm), but this passes the raw realm name to the resource-bundle lookup. For realm names containing spaces or other encoded characters, the helper cannot find the bundle and skips cleanup; pass the encoded namespace here.
Review effort: Balanced
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
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.
Summary
useRefreshTokenswatch value torefreshTokensEnabledto avoid false-positive hook detectionuseCallback(debounce(...))withuseMemoinUserSelectandIdentityProviderSelectFlowRequirementDropdown,GroupPickerDialog,ClusteringPanel, andEditUserdeleteon optional chaining withomit()inNewAttributeSettingsandPartialImportRealmOverridesin favor ofi18n.reloadResources()Closes #52903
Follow-up
Remaining
react-compiler/react-compilerwarnings (primarilyuseRoutableTabhook wrappers) are tracked in #52900.