Page MenuHomePhabricator

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

Authored by atul on Apr 25 2023, 1:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 8:17 AM
Unknown Object (File)
Thu, Oct 31, 4:32 PM
Unknown Object (File)
Thu, Oct 31, 4:32 PM
Unknown Object (File)
Thu, Oct 31, 4:32 PM
Unknown Object (File)
Thu, Oct 31, 4:32 PM
Unknown Object (File)
Thu, Oct 31, 4:30 PM
Unknown Object (File)
Thu, Oct 31, 4:28 AM
Unknown Object (File)
Oct 5 2024, 9:36 PM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #25648)

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.