HomePhabricator
Diffusion Comm 8fc5e88db124

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

Description

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

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

Reviewers: ashoat, kamil

Reviewed By: ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D12500

Details

Provenance
ginsuAuthored on Jun 19 2024, 4:51 PM
Reviewer
ashoat
Differential Revision
D12500: [native/web] fix manage farcaster channel tag permission migration
Parents
rCOMM32270fba0afa: [lib] remove updateThreadStoreThreadInfos util function
Branches
Unknown
Tags
Unknown