diff --git a/lib/types/thread-permission-types.js b/lib/types/thread-permission-types.js --- a/lib/types/thread-permission-types.js +++ b/lib/types/thread-permission-types.js @@ -382,11 +382,6 @@ threadPermissionFilterPrefixes.OPEN + threadPermissions.KNOW_OF, - // descendant_open_voiced - threadPermissionPropagationPrefixes.DESCENDANT + - threadPermissionFilterPrefixes.OPEN + - threadPermissions.VOICED, - // visible | descendant_open_visible threadPermissions.VISIBLE, threadPermissionPropagationPrefixes.DESCENDANT + diff --git a/lib/utils/migration-utils.js b/lib/utils/migration-utils.js --- a/lib/utils/migration-utils.js +++ b/lib/utils/migration-utils.js @@ -18,6 +18,11 @@ DraftStore, } from '../types/draft-types'; import type { RawMessageInfo } from '../types/message-types.js'; +import { + threadPermissions, + threadPermissionPropagationPrefixes, + threadPermissionFilterPrefixes, +} from '../types/thread-permission-types.js'; import type { ThreadStoreThreadInfos } from '../types/thread-types.js'; function convertDraftKeyToNewIDSchema(key: string): string { @@ -116,6 +121,17 @@ return messageInfos; } +// This is an array of all permissions that need to be removed +// in an upcoming migration for roles. Once the migrations are landed, +// no changes to this array should be made to prevent future migrations +// from having unexpected behavior. +// See context in https://linear.app/comm/issue/ENG-5622/#comment-2d98a2cd +const permissionsToRemoveInMigration: $ReadOnlyArray = [ + threadPermissionPropagationPrefixes.DESCENDANT + + threadPermissionFilterPrefixes.OPEN + + threadPermissions.VOICED, +]; + export { convertDraftKeyToNewIDSchema, convertDraftStoreToNewIDSchema, @@ -125,4 +141,5 @@ convertNonPendingIDToNewSchema, convertIDToNewSchema, convertNotificationMessageInfoToNewIDSchema, + permissionsToRemoveInMigration, };