diff --git a/ts/types/StorageKeys.std.ts b/ts/types/StorageKeys.std.ts index 4da1bfcea4..6f89e459fa 100644 --- a/ts/types/StorageKeys.std.ts +++ b/ts/types/StorageKeys.std.ts @@ -363,8 +363,49 @@ export const STORAGE_KEYS_TO_PRESERVE_AFTER_UNLINK = [ 'uuid_id', 'pni', - // Local backups + // Items required for local backups + 'accountEntropyPool', 'backupKeyViewedHash', + 'backupMediaRootKey', + 'lastLocalBackup', + 'localBackupFolder', + + // Items included in local backups + 'profileKey', + 'avatarUrl', + 'usernameLinkColor', + 'androidSpecificSettings', + 'subscriberId', + 'subscriberCurrencyCode', + 'auto-download-attachment-primary', + 'phoneNumberSharingMode', + 'phoneNumberDiscoverability', + 'preferContactAvatars', + 'universalExpireTimer', + 'displayBadgesOnProfile', + 'keepMutedChatsArchived', + 'hasSetMyStoriesPrivacy', + 'hasViewedOnboardingStory', + 'hasKeyTransparencyDisabled', + 'hasStoriesDisabled', + 'preferredReactionEmoji', + 'androidSpecificSettings', + 'sealedSenderIndicators', + 'storyViewReceiptsEnabled', + 'hasCompletedUsernameOnboarding', + 'hasSeenGroupStoryEducationSheet', + 'hasSeenAdminDeleteEducationDialog', + 'callsUseLessDataSetting', + 'optimizeOnDeviceStorage', + 'allowSealedSenderFromAnyone', + 'pinReminders', + 'screenLockTimeoutMinutes', + 'sent-media-quality', + 'defaultWallpaperPreset', + 'defaultWallpaperPhotoPointer', + 'defaultDimWallpaperInDarkMode', + 'defaultAutoBubbleColor', + 'restoredBackupFirstAppVersion', ] as const satisfies ReadonlyArray; const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ @@ -378,20 +419,12 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'blocked', 'device_name', 'deviceCreatedAt', - 'hasSetMyStoriesPrivacy', - 'hasCompletedUsernameOnboarding', - 'hasSeenGroupStoryEducationSheet', 'hasSeenNotificationProfileOnboarding', 'hasSeenKeyTransparencyOnboarding', - 'hasViewedOnboardingStory', - 'hasStoriesDisabled', - 'hasKeyTransparencyDisabled', - 'storyViewReceiptsEnabled', 'identityKeyMap', 'lastAttemptedToRefreshProfilesAt', 'lastResortKeyUpdateTime', 'lastResortKeyUpdateTimePNI', - 'accountEntropyPool', 'masterKey', 'accountEntropyPoolLastRequestTime', 'maxPreKeyId', @@ -399,13 +432,11 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'maxKyberPreKeyId', 'maxKyberPreKeyIdPNI', 'password', - 'profileKey', 'regionCode', 'registrationIdMap', 'remoteBuildExpiration', 'sessionResets', 'seenPinMessageDisappearingMessagesWarningCount', - 'hasSeenAdminDeleteEducationDialog', 'signedKeyId', 'signedKeyIdPNI', 'signedKeyUpdateTime', @@ -415,17 +446,11 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'userAgent', 'useRingrtcAdm', 'linkPreviews', - 'universalExpireTimer', 'retryPlaceholders', 'donationWorkflow', 'chromiumRegistrationDone', - 'phoneNumberSharingMode', - 'phoneNumberDiscoverability', - 'preferContactAvatars', 'typingIndicators', - 'sealedSenderIndicators', 'storageFetchComplete', - 'avatarUrl', 'manifestVersion', 'manifestRecordIkm', 'storageCredentials', @@ -440,7 +465,6 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'callLinkAuthCredentials', 'backupCombinedCredentials', 'backupCombinedCredentialsLastRequestTime', - 'backupMediaRootKey', 'backupMediaDownloadTotalBytes', 'backupMediaDownloadCompletedBytes', 'backupMediaDownloadPaused', @@ -459,18 +483,13 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'paymentAddress', 'nextScheduledUpdateKeyTime', 'areWeASubscriber', - 'subscriberId', - 'subscriberCurrencyCode', 'donorSubscriptionManuallyCancelled', 'backupsSubscriberId', 'backupsSubscriberPurchaseToken', 'backupsSubscriberOriginalTransactionId', - 'displayBadgesOnProfile', - 'keepMutedChatsArchived', 'usernameLastIntegrityCheck', 'usernameCorrupted', 'usernameLinkCorrupted', - 'usernameLinkColor', 'usernameLink', 'serverAlerts', 'needOrphanedAttachmentCheck', @@ -488,28 +507,12 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'backupTier', 'cloudBackupStatus', 'backupSubscriptionStatus', - 'backupKeyViewed', - 'lastLocalBackup', - 'localBackupFolder', 'isRestoredFromBackup', - 'restoredBackupFirstAppVersion', - 'svrPin', - 'optimizeOnDeviceStorage', - 'pinReminders', - 'screenLockTimeoutMinutes', - 'auto-download-attachment-primary', - 'androidSpecificSettings', - 'callsUseLessDataSetting', - 'allowSealedSenderFromAnyone', 'postRegistrationSyncsStatus', 'avatarsHaveBeenMigrated', 'lastDistinguishedTreeHead', 'keyTransparencySelfHealth', 'lastKeyTransparencySelfCheck', - 'defaultWallpaperPhotoPointer', - 'defaultWallpaperPreset', - 'defaultDimWallpaperInDarkMode', - 'defaultAutoBubbleColor', 'challenge:retry-message-ids', 'nextSignedKeyRotationTime', 'previousAudioDeviceModule', @@ -533,6 +536,8 @@ const STORAGE_KEYS_TO_REMOVE_AFTER_UNLINK = [ 'groupMaxBitrate', 'isGroupVp9Enabled', 'sfuUrl', + 'svrPin', + 'backupKeyViewed', ] as const satisfies ReadonlyArray; // Ensure every storage key is explicitly marked to be preserved or removed on unlink.