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)
Tue, Nov 26, 11:54 AM
Unknown Object (File)
Mon, Nov 25, 6:25 PM
Unknown Object (File)
Mon, Nov 25, 5:57 PM
Unknown Object (File)
Mon, Nov 25, 5:48 PM
Unknown Object (File)
Mon, Nov 25, 5:38 PM
Unknown Object (File)
Mon, Nov 25, 5:35 PM
Unknown Object (File)
Mon, Nov 25, 5:29 PM
Unknown Object (File)
Mon, Nov 25, 3:51 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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

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

48 ↗(On Diff #44809)

Do we really need this log?

web/redux/persist.js
656 ↗(On Diff #44970)

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

663 ↗(On Diff #44970)

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.