Page MenuHomePhabricator

[native/web] fix manage farcaster channel tag permission migration
ClosedPublic

Authored by ginsu on Jun 19 2024, 5:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 1:57 PM
Unknown Object (File)
Oct 12 2024, 1:00 PM
Unknown Object (File)
Oct 12 2024, 1:00 PM
Unknown Object (File)
Oct 12 2024, 1:00 PM
Unknown Object (File)
Oct 12 2024, 12:58 PM
Unknown Object (File)
Oct 12 2024, 12:58 PM
Unknown Object (File)
Oct 9 2024, 5:55 AM
Unknown Object (File)
Sep 28 2024, 5:13 AM
Subscribers

Details

Summary

With migration 77, I had a huge misunderstanding about the new migration approach. I thought for this migration we needed to create and directly return a new thread store state to redux using .processStoreOperations(). However, we actually should only just return the operations and just return state as is. The threadStore will be read by SQLiteDataHandler which populates redux with the migrated data from the ops.

This diff introduces migration 78 which should fix the manage faarcaster channel tag permission migration

Depends on D12499

Test Plan

ran the migration on a release build, confirmed that I was not entering handleReduxMigrationFailure.

Additionally logged the following in native/components/community-actions-button.react.js and got these results:

const canManageFarcasterChannelTags = useThreadHasPermission(
  community,
  threadPermissions.MANAGE_FARCASTER_CHANNEL_TAGS,
);

console.log('canManageFarcasterChannelTags', canManageFarcasterChannelTags);

Screenshot 2024-06-19 at 8.43.55 PM.png (486×1 px, 84 KB)

(I am an admin of comm supporters and a personal test community so I expected to have two true values here)

Additionally did one final test to confirm that users were not forcefully being logged out due to the failed migration:

  1. arc patch D12503 (this is the last diff for this stack)
  2. git checkout mobile-v1.0.354
  3. Removed native/facts/authoritative_keyserver.json
  4. yarn cleaninstall
  5. Delete the app from iOS simulator
  6. Do an iOS release build to iOS simulator
  7. git checkout arcpatch-D12503
  8. yarn cleaninstall
  9. Do an iOS release build to iOS simulator

Confirmed I got no "redux migration failure" logs (added this log to native/redux/handle-redux-migration-failure.js just like in this patch).

Also when I did the new release build after following all the steps, I was not logged out of the app, and was able to confirm that I could manage farcaster channel tags for communities that I am an admin in

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: ashoat, kamil.
ginsu edited the summary of this revision. (Show Details)
ginsu requested review of this revision.Jun 19 2024, 6:52 PM

I didn’t have much time to review, but this looks simple and safe. Can you update your test plan to include testing migrating from build 354 to master + your stack, in a process similar to what I described on the Linear task?

This revision is now accepted and ready to land.Jun 19 2024, 6:58 PM