fix(roles): refresh UI after resricting collection item read - #179
Open
amadulhaxxani wants to merge 2 commits into
Open
fix(roles): refresh UI after resricting collection item read#179amadulhaxxani wants to merge 2 commits into
amadulhaxxani wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a UI staleness issue in the collection/community “Assign Roles” view where clicking Restrict (POST to /itemReadGroup) didn’t refresh the displayed group until a manual page reload.
Changes:
- After a successful role-group creation, explicitly triggers a fresh
findByHref(..., useCachedVersionIfAvailable=false, ...)to force a new GET and refresh the UI state. - Adds RxJS operator usage to ensure the refresh request is executed once and the subscription completes.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem description
When clicking Restrict on "Default item read access" in a collection's Assign Roles tab, the UI does not update – it still shows Anonymous + Restrict until the page is manually refreshed.
Analysis
The
create()method incomcol-role.component.tsPOSTs to/itemReadGroupand the backend returns 201 with the new group. However, the frontend only marks the cached GET as stale – it does not force a new GET. The cache system stores only GET responses under the href; POST responses are not indexed as alternatives. As a result, the UI keeps showing the old cached "Anonymous" response.The
delete()method works correctly because after DELETE (204), it forces a new GET.Fix: After a successful POST, force a fresh GET of
/itemReadGroupwithuseCachedVersionIfAvailable = false.Copilot review