[
https://issues.apache.org/jira/browse/RANGER-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18085160#comment-18085160
]
Krishna Chaitanya Muttevi edited comment on RANGER-5623 at 6/1/26 9:51 AM:
---------------------------------------------------------------------------
The issue was resolved by
1. Adding the validation checks whether the {{xGroup}} and {{xUser}} exists
2. Setting the {{ParentGroupId}} of {{vXGroupUser}} to {{{}xGroup{}}}’s id
which was not present
In the {{updateXGroupUser()}} in {{XUserMgr.java}}
!image-2026-06-01-15-20-34-944.png|width=565,height=325!
in group’s tab also the change is visible
!image-2026-06-01-15-21-13-693.png|width=567,height=324!
was (Author: JIRAUSER313532):
The issue was resolved by
1. Adding the validation checks whether the {{xGroup}} and {{xUser}} exists
2. Setting the {{ParentGroupId}} of {{vXGroupUser}} to {{{}xGroup{}}}’s id
which was not present
In the {{updateXGroupUser()}} in {{XUserMgr.java}}
{{!https://media-cdn.atlassian.com/file/5daa7b42-5248-4a1d-a93d-b252d8ac5d8f/image/cdn?allowAnimated=true&client=b47d7f8e-a692-4580-bc50-5af50f9cf45a&collection=&height=125&max-age=2592000&mode=full-fit&source=mediaCard&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJiNDdkN2Y4ZS1hNjkyLTQ1ODAtYmM1MC01YWY1MGY5Y2Y0NWEiLCJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpmaWxlOjA5ZmY1YWFmLWQzYTEtNGJlNS1hNzQ3LTRkM2Q5ZjJiZTkzMCI6WyJyZWFkIl0sInVybjpmaWxlc3RvcmU6ZmlsZTo1ZGFhN2I0Mi01MjQ4LTRhMWQtYTkzZC1iMjUyZDhhYzVkOGYiOlsicmVhZCJdLCJ1cm46ZmlsZXN0b3JlOmZpbGU6MzM2NjYzMDItOWI2Ni00YjdkLTgwMGMtOWQ1YmM1YTJiMGEzIjpbInJlYWQiXSwidXJuOmZpbGVzdG9yZTpmaWxlOmM1ODgzZjc4LTU4MDgtNDk0YS05OWI3LTAyZjU1NzJkZjMyNCI6WyJyZWFkIl19LCJleHAiOjE3ODAzMDUzMTgsIm5iZiI6MTc4MDMwNDQxOCwiYWFJZCI6IjcxMjAyMDpkZTVlNDE1Mi1mYmU2LTRkZWMtYmI4Yy1lNjhmZmMyMzIwZTEiLCJodHRwczovL2lkLmF0bGFzc2lhbi5jb20vYXBwQWNjcmVkaXRlZCI6ZmFsc2V9.i0KbzpEqJNL2zC3Q9mUyh771l6BlLHZ312P6c14ywvk&width=605#media-blob-url=true&id=5daa7b42-5248-4a1d-a93d-b252d8ac5d8f&clientId=b47d7f8e-a692-4580-bc50-5af50f9cf45a&contextId=&collection=!}}
in group’s tab also the change is visible
!https://media-cdn.atlassian.com/file/c5883f78-5808-494a-99b7-02f5572df324/image/cdn?allowAnimated=true&client=b47d7f8e-a692-4580-bc50-5af50f9cf45a&collection=&height=125&max-age=2592000&mode=full-fit&source=mediaCard&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJiNDdkN2Y4ZS1hNjkyLTQ1ODAtYmM1MC01YWY1MGY5Y2Y0NWEiLCJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpmaWxlOjA5ZmY1YWFmLWQzYTEtNGJlNS1hNzQ3LTRkM2Q5ZjJiZTkzMCI6WyJyZWFkIl0sInVybjpmaWxlc3RvcmU6ZmlsZTo1ZGFhN2I0Mi01MjQ4LTRhMWQtYTkzZC1iMjUyZDhhYzVkOGYiOlsicmVhZCJdLCJ1cm46ZmlsZXN0b3JlOmZpbGU6MzM2NjYzMDItOWI2Ni00YjdkLTgwMGMtOWQ1YmM1YTJiMGEzIjpbInJlYWQiXSwidXJuOmZpbGVzdG9yZTpmaWxlOmM1ODgzZjc4LTU4MDgtNDk0YS05OWI3LTAyZjU1NzJkZjMyNCI6WyJyZWFkIl19LCJleHAiOjE3ODAzMDUzMTgsIm5iZiI6MTc4MDMwNDQxOCwiYWFJZCI6IjcxMjAyMDpkZTVlNDE1Mi1mYmU2LTRkZWMtYmI4Yy1lNjhmZmMyMzIwZTEiLCJodHRwczovL2lkLmF0bGFzc2lhbi5jb20vYXBwQWNjcmVkaXRlZCI6ZmFsc2V9.i0KbzpEqJNL2zC3Q9mUyh771l6BlLHZ312P6c14ywvk&width=605#media-blob-url=true&id=c5883f78-5808-494a-99b7-02f5572df324&clientId=b47d7f8e-a692-4580-bc50-5af50f9cf45a&contextId=&collection=!
> UI Inconsistency: Groups tab userlist fails to reflect updated user-group
> mapping after successful PUT /xusers/groupusers request
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: RANGER-5623
> URL: https://issues.apache.org/jira/browse/RANGER-5623
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Affects Versions: 3.0.0
> Reporter: Krishna Chaitanya Muttevi
> Priority: Major
> Attachments: image-2026-06-01-15-18-09-118.png,
> image-2026-06-01-15-19-37-436.png, image-2026-06-01-15-20-34-944.png,
> image-2026-06-01-15-21-13-693.png
>
>
> When updating an existing user-group relationship via the {{PUT
> /service/xusers/groupusers}} API, the backend processes the change
> successfully. The UI's "Users" tab correctly reflects the updated group
> association for the user. However, the "Groups" tab fails to update and
> displays stale data, keeping the user listed under the old group and omitting
> them from the new group.
> This indicates a localized state management or caching issue specifically
> within the "Groups" tab component of the web interface.
> h3. *Steps to Reproduce:*
> # *Create a new user-group relation (User 17 to 'opensearch'):*
>
> {{curl -iu admin:***** -X POST
> 'http://localhost:6080/service/xusers/groupusers' \ -H 'accept:
> application/json' -H 'Content-Type: application/json' \ -d '
> {"name":"opensearch", "userId": 17}
> ' }}
> _Backend returns 200 OK, creating relation_ {{{}id: 52{}}}{_}.{_}
> # *Update the existing relation to a different group (User 17 to 'ranger'):*
>
> {{curl -iu admin:***** -X PUT
> 'http://localhost:6080/service/xusers/groupusers' \ -H 'Content-Type:
> application/json' \ -d '\{"id": 52, "name": "ranger", "userId": 17}'}}
> _Backend returns 200 OK, confirming the update._
> # *Verify backend state via GET:*
>
> {{curl -iu admin:***** -X GET
> 'http://localhost:6080/service/xusers/groupusers/52'}}
> _Backend correctly returns_
> {"id":52, ... "name":"ranger","userId":17}
> # *Observe the UI behavior:*
> * Navigate to {*}Settings > Users/Groups/Roles{*}.
> * Check the *Users* tab: User 17 is correctly shown under the {{ranger}}
> group.
> * Check the *Groups* tab: Inspect the user lists for both the {{opensearch}}
> and {{ranger}} groups.
> h3. *Expected Behavior:*
> Both the "Users" tab and the "Groups" tab should remain synchronized with the
> backend. In the "Groups" tab, User 17 should be removed from the
> {{opensearch}} user list and added to the {{ranger}} user list immediately.
> h3. *Actual Behavior:*
> The "Users" tab reflects the correct backend state, but the "Groups" tab does
> not. The "Groups" tab UI retains stale data, ignoring the {{PUT}} mutation
> until a hard refresh or application cache invalidation occurs.
> Here the ranger group’s user list not updated:
> !image-2026-06-01-15-18-09-118.png|width=691,height=397!
>
>
> But om’s groupList is updated correctly.
> !image-2026-06-01-15-19-37-436.png|width=700,height=404!
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)