Performed three different tests:
1. Manually tested the code that updated `threadInfos`:
```
const threadStore = { ... } // threadStore contents here
const permissionsToRemoveInMigration = [ ... ] // permissionsToRemoveInMigration contents here
const updatedThreadInfos = {};
const threadInfos = threadStore.threadInfos;
for (const threadID in threadInfos) {
const threadInfo = threadInfos[threadID];
const { roles } = threadInfo;
const updatedRoles = {};
for (const roleID in roles) {
const role = roles[roleID];
const { permissions: rolePermissions } = role;
const updatedPermissions = {};
for (const permission in rolePermissions) {
if (!permissionsToRemoveInMigration.includes(permission)) {
updatedPermissions[permission] = rolePermissions[permission];
}
}
updatedRoles[roleID] = { ...role, permissions: updatedPermissions };
}
const updatedThreadInfo = {
...threadInfo,
roles: updatedRoles,
};
// Nothing should log here (testing: nothing logs)
for (const roleID in updatedRoles) {
const role = updatedRoles[roleID];
const { permissions: rolePermissions } = role;
for (const permission in rolePermissions) {
if (permissionsToRemoveInMigration.includes(permission)) {
console.log('found incorrect permission: ', roleID);
}
}
}
updatedThreadInfos[threadID] = updatedThreadInfo;
}
```
2. Confirmed the results of the migration itself:
-- Open `native` and run `yarn redux-devtools` to inspect `threadStore`
-- Verified that some roles had some of the incorrect permissions
-- Upgraded the persist version to trigger the migration
-- Confirmed that the migration succeeded
-- Checked the redux devtools for the same roles and confirmed that there were some less permissions (introspecting into the permissions confirmed that the expected permissions were removed)
-- Waited a few minutes and confirmed that the client did not detect any inconsistencies
3. Wrote unit tests and ran `yarn workspace native test`