Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46006 +/- ##
=======================================
Coverage 85.03% 85.04%
=======================================
Files 3080 3080
Lines 209437 209465 +28
Branches 49385 49401 +16
=======================================
+ Hits 178095 178130 +35
+ Misses 27960 27953 -7
Partials 3382 3382
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rebenitez1802
left a comment
There was a problem hiding this comment.
Request changes: the hydration gate fixes a real data-loss bug and the tests are thorough, but one regression needs fixing before merge.
🔴 High — Closing the modal mid-save skips the list refresh, hides failures and can re-grant removed access
RoleListEditModal.tsx only calls onSave and the save toasts when mounted.current. While a save is in flight, Cancel / X / Esc / mask stay enabled, and RolesList unmounts the editor on close. So closing mid-save means refreshData() never runs, and a failed save shows no toast at all. Because the list keeps the stale role row, the following sequence silently re-grants Group 2: remove Group 2, Save, Cancel while saving, reopen the same role, rename it, Save. That sends updateRoleGroups(1, [1, 2]), and permissions behave the same way. All three cases pass on master and fail on this branch.
Fix: drop the mounted ref and its three gates (inline suggestions below). This is master's existing behaviour; there, the stale onSave also closes a reopened modal, which discards the stale role copy. Then update the "a save finishing after closing…" test to expect onSave and the success toast once. With these suggestions applied, the full RoleListEditModal suite (44 tests) and the close-mid-save repros pass, and oxlint/oxfmt are clean.
88810c6 to
b12297e
Compare
|
Thanks @rebenitez1802 for the quick review and the feedback! |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
madhushreeag
left a comment
There was a problem hiding this comment.
The fix is correct, the users-vs-permissions/groups asymmetry is sound, and it ships with a genuine regression test 🚀
|
@dmunozv04 , can you rebase your branch with master? |
4994b4a to
265a68b
Compare
rebenitez1802
left a comment
There was a problem hiding this comment.
Approve: the round-1 blocker is fixed, and the tests guard it. Thanks for the quick turnaround and the extra failure-after-close test! I verified that restoring the round-1 mounted gates fails both after-close tests (each gate is caught on its own). A page-level RolesList probe of a stale save after close/reopen behaves exactly like master, so there's no new risk from removing the gate.
|
Thanks @rebenitez1802 and @madhushreeag! |
265a68b to
12cdeb1
Compare
SUMMARY
The role editor allowed saving changes before the role's existing users, groups and permissions had finished loading. This could unintentionally remove them from the role if a user saved too early.
This change prevents saving until all existing role data has finished loading, or if any of the requests fail.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE:
https://github.com/user-attachments/assets/75d0bcc6-76ca-4e60-ba3c-74eaf7374068
The video shows a role being renamed and saved before its users have finished loading (simulated using DevTools network throttling), causing those users to be removed from the role.
TESTING INSTRUCTIONS
api/v1/security/users/?q=(filters:!((col:roles,opr:rel_m_m,value:6))), where 6 is the role ID)The new tests cover this regression and fail when run against
master. (27 failed)ADDITIONAL INFORMATION