Page MenuHomePhabricator

[native] Introduce `recursivelyUpdateCurrentMemberPermissions(...)`
ClosedPublic

Authored by atul on Apr 25 2023, 1:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 1, 2:32 PM
Unknown Object (File)
Tue, Oct 1, 2:32 PM
Unknown Object (File)
Tue, Oct 1, 2:32 PM
Unknown Object (File)
Tue, Oct 1, 2:32 PM
Unknown Object (File)
Tue, Oct 1, 2:29 PM
Unknown Object (File)
Mon, Sep 16, 5:41 PM
Unknown Object (File)
Aug 27 2024, 6:15 AM
Unknown Object (File)
Aug 25 2024, 5:28 AM
Subscribers

Details

Summary

We introduce recursivelyUpdateCurrentMemberPermissions(...) which traverses node and all children recursively to update threadInfo.currentUser.permissions.

Very similar to D7602 but handles currentUser.permissions isntead of member.permissions


Depends on D7602

Test Plan

Ran with correct threadStore and ensured that it remained the same.

Added a unit test to ensure that currentUser.permissions could be "constructed from scratch" (without depending on any existing currentUser.permissions

Similar to D7602 ran into some issues with my prod thread store. Specifically threadID: 892819 and roleID: 89280, hoping I can sync w/ @ashoat in the office tomorrow to troubleshoot since I don't have access to prod DB.

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Apr 25 2023, 2:03 AM
ashoat added inline comments.
native/redux/update-roles-and-permissions.js
146–148

Can we make these all forEach?

This revision is now accepted and ready to land.Apr 25 2023, 4:10 AM
This revision was landed with ongoing or failed builds.Apr 25 2023, 1:02 PM
This revision was automatically updated to reflect the committed changes.