Page MenuHomePhabricator

[web] Introduce `web` migration to strip member permissions
ClosedPublic

Authored by atul on Jul 17 2024, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 7:29 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Unknown Object (File)
Wed, Nov 20, 9:47 AM
Subscribers
None

Details

Summary

Effectively the same as D12789, but for web.


Depends on D12789

Test Plan

Before (thin, with member permissions):

Screenshot 2024-10-08 at 4.24.03 PM.png (2×2 px, 581 KB)

Before (thick, with member permissions):

Screenshot 2024-10-08 at 4.24.24 PM.png (2×2 px, 598 KB)


After (thin, WITHOUT member permissions):

Screenshot 2024-10-08 at 4.25.16 PM.png (2×2 px, 648 KB)

After (thick, still WITH member permissions):

Screenshot 2024-10-08 at 4.25.38 PM.png (2×2 px, 639 KB)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Jul 17 2024, 4:25 PM
ashoat added inline comments.
web/redux/persist.js
648–650 ↗(On Diff #42430)

Same feedback here as in D12789

This revision is now accepted and ready to land.Jul 18 2024, 12:14 PM

address feedback (any-cast stripMemberPermissionsFromRawThreadInfos instead of $FlowIgnore)

workaround that works for now (DRAFT)

update migration to work with new migration system

Okay this migration now appears to work.

Would be great if others could test in their environments as well to make sure nothing breaks. Basically just need to patch this in and increment storeVersion to 84 and the migration should run. Can use https://phab.comm.dev/D13561 as reference.

Screenshot 2024-10-01 at 6.41.59 PM.png (460×1 px, 83 KB)

atul planned changes to this revision.Oct 1 2024, 7:17 PM

Will make some changes before landing eg

  • Go from FlowFixMe to something like FlowIgnore
  • Remove logs related skipping ThickThreads

(Will be available noon onwards tomorrow to work on this)

rebase after type changes

This revision is now accepted and ready to land.Oct 8 2024, 12:04 PM

remove console log and change flowfixme to flowignore

lib/utils/member-info-utils.js
48 ↗(On Diff #44809)

Do we really need this log?

46

Can we avoid this if we update ThreadStoreWithMemberPermissions to include thick threads?

web/redux/persist.js
656

Can you cast the function to MigrationFunction<WebNavInfo, AppState> to match the other ones, and catch type errors like ops: [] below?

663

Shouldn't this be {}?

update ThreadStoreWithMemberPermissions to include thick threads

cast to migration function

include native migration here (was previously in flip the switch)

This revision was landed with ongoing or failed builds.Oct 8 2024, 2:05 PM
This revision was automatically updated to reflect the committed changes.