-
Notifications
You must be signed in to change notification settings - Fork 42
UIU-3499: Handle an undefined of assignedRoleIds in UserRolesModal. Clear cache after roles update to avoid displaying stale data (follow-up).
#3001
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
Conversation
54076bb to
b44871b
Compare
assignedRoleIds in UserRolesModal. Clear update cache after roles update to avoid displaying incorrect data (follow-up).assignedRoleIds in UserRolesModal. Clear cache after roles update to avoid displaying incorrect data (follow-up).
assignedRoleIds in UserRolesModal. Clear cache after roles update to avoid displaying incorrect data (follow-up).assignedRoleIds in UserRolesModal. Clear cache after roles update to avoid displaying stale data (follow-up).
2738652 to
76797d0
Compare
…lear update cache after roles update to avoid displaying incorrect data.
76797d0 to
de2c81b
Compare
|
…lear update cache after roles update to avoid displaying incorrect data. (#3001)
zburke
left a comment
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.
These changes look fine, though I don't see how assignedRoleIds was ever undefined; it's initialized to an empty object so the swap from
assignedRoleIds[tenantId] ? assignedRoleIds[tenantId].concat(id) : [id]
to
(assignedRoleIds[tenantId] || []).concat(id)
should not have had any effect. Am I missing something?
Please address Sonar's complaint before you merge to avoid adding new tech-debt.
| }).catch(sendErrorCallout); | ||
| }) | ||
| .then(async () => { | ||
| await queryClient.invalidateQueries({ queryKey: [namespace, userId, tenantIdKey] }); | ||
| }) | ||
| .catch(sendErrorCallout); |
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.
Sonar is grumpy about how deeply nested this is. Let's convert it all to async/await instead of mixing that with promise chaining. I think that'll satisfy Sonar, and it'll be more consistent.



Purpose
Issues
https://folio-org.atlassian.net/browse/UIU-3499
Approach
TODOS and Open Questions
Learning
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.