-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[frontend] Fix for user deletion on cache + prevent loop on error on Private Root (#9719) #9720
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9720 +/- ##
==========================================
+ Coverage 65.24% 66.24% +1.00%
==========================================
Files 630 630
Lines 60273 60420 +147
Branches 6763 7340 +577
==========================================
+ Hits 39325 40028 +703
+ Misses 20948 20392 -556 ☔ View full report in Codecov by Sentry. |
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.
I works for me apart from the translation question
@@ -78,7 +83,7 @@ class ErrorBoundaryComponent extends React.Component { | |||
const types = map((e) => e.extensions.code, [...baseErrors, ...retroErrors]); | |||
// Specific error catching | |||
if (includes('COMPLEX_SEARCH_ERROR', types)) { | |||
return <DedicatedWarning title={'Complex search'} description={'Your search have too much terms to be executed. Please limit the number of words or the complexity'}/>; | |||
return <DedicatedWarning title={'Complex search'} description={'Your search have too much terms to be executed. Please limit the number of words or the complexity'} />; |
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.
Should we also translate this ?
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.
I don't think I can inject formatter in ErrorBoundary
@@ -141,7 +141,7 @@ const platformUsers = (context: AuthContext) => { | |||
const reloadUsers = async () => { | |||
const users = await listAllEntities(context, SYSTEM_USER, [ENTITY_TYPE_USER], { connectionFormat: false }); | |||
const allUserIds = users.map((user) => user.internal_id); | |||
return Bluebird.map(allUserIds, (userId: string) => resolveUserById(context, userId), { concurrency: ES_MAX_CONCURRENCY }); | |||
return Bluebird.map(allUserIds, (userId: string) => resolveUserById(context, userId), { concurrency: ES_MAX_CONCURRENCY }).filter((u) => u != null); |
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.
why adding this filter ? can it happen ? since we just loaded the users from the database.
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.
Yes, there could be a weird race-case scenario where the cache is reset while a user is being deleted -> users contains an ID that exists no longer in elastic.
Closes #9719
1 - User deletion doesn't trigger cache reset, hence we are trying to get a user from the cache that is deleted
2 - The default error boundary component is not usable is RootPrivate fails because it requires Intl