Skip to content

Commit 7e20f35

Browse files
backups: Allow subscriber data in their backup even on the free tier
1 parent 4675bb8 commit 7e20f35

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
v0.80.0
22

3+
- backups: relax restriction that backups with backup_tier == free cannot have backupsSubscriberData
4+
35
- Migrate crates to Rust 2024 edition.
46

57
- Desktop: add a distinct error type for incremental mac verification failures.

rust/message-backup/src/backup/account_data.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ pub enum AccountDataError {
162162
BackupSubscription(SubscriptionError),
163163
/// unknown backup tier value: {0}
164164
UnknownBackupTier(u64),
165-
/// backup subscription is present with free tier
166-
BackupSubscriptionWithFreeTier,
167165
/// optimize on device storage is enabled without paid tier
168166
OptimizeStorageWithoutPaidTier,
169167
}
@@ -215,11 +213,6 @@ impl<M: Method + ReferencedTypes, C: ReportUnusualTimestamp> TryIntoWith<Account
215213
.into_option()
216214
.ok_or(AccountDataError::MissingSettings)?;
217215

218-
let backup_tier = account_settings_proto.backupTier;
219-
if backup_tier == Some(BackupLevel::Free as u64) && backupsSubscriberData.is_some() {
220-
return Err(AccountDataError::BackupSubscriptionWithFreeTier);
221-
}
222-
223216
let account_settings = account_settings_proto.try_into_with(context)?;
224217

225218
let donation_subscription = donationSubscriberData
@@ -644,11 +637,13 @@ mod test {
644637
Ok(());
645638
"no_backup_tier_no_subscription"
646639
)]
640+
// Both iOS and Android teams confirm that it's possible and legal to end up
641+
// on the free tier with some subscription information stored in your backup.
647642
#[test_case(
648643
|x| {
649644
x.accountSettings.as_mut().unwrap().backupTier = Some(BackupLevel::Free.into());
650645
} =>
651-
Err(AccountDataError::BackupSubscriptionWithFreeTier);
646+
Ok(());
652647
"backup_subscription_with_free_tier"
653648
)]
654649
#[test_case(

0 commit comments

Comments
 (0)