Skip to content

fix(roles): refresh UI after resricting collection item read - #179

Open
amadulhaxxani wants to merge 2 commits into
clarin-v7from
178-restricting-default-item-read-on-a-collection-has-issues
Open

fix(roles): refresh UI after resricting collection item read#179
amadulhaxxani wants to merge 2 commits into
clarin-v7from
178-restricting-default-item-read-on-a-collection-has-issues

Conversation

@amadulhaxxani

Copy link
Copy Markdown

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 in comcol-role.component.ts POSTs to /itemReadGroup and 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 /itemReadGroup with useCachedVersionIfAvailable = false.

Copilot review

  • Requested review from Copilot

Copilot AI lite review requested due to automatic review settings August 17, 2026 12:58
@amadulhaxxani amadulhaxxani linked an issue Aug 17, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restricting default item read on a collection has issues

2 participants