Page MenuHomePhabricator

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

Authored by atul on Apr 25 2023, 1:46 AM.
Tags
None
Referenced Files
F2208113: D7603.id25648.diff
Sun, Jul 7, 11:52 AM
Unknown Object (File)
Fri, Jul 5, 3:14 PM
Unknown Object (File)
Tue, Jul 2, 9:11 PM
Unknown Object (File)
Tue, Jul 2, 9:55 AM
Unknown Object (File)
Tue, Jul 2, 5:02 AM
Unknown Object (File)
Sun, Jun 30, 10:39 AM
Unknown Object (File)
Thu, Jun 27, 11:24 PM
Unknown Object (File)
Thu, Jun 27, 6:53 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.