mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 15:58:06 +01:00
Preserve backupCredentialRequest across rereg
This commit is contained in:
committed by
ravi-signal
parent
6fcb2ab5dd
commit
075a08884b
@@ -416,6 +416,23 @@ class AccountsTest {
|
||||
Collections.emptyList()).toCompletableFuture().join());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testReclaimAccountPreservesBcr() {
|
||||
final String e164 = "+14151112222";
|
||||
final UUID existingUuid = UUID.randomUUID();
|
||||
final Account existingAccount =
|
||||
generateAccount(e164, existingUuid, UUID.randomUUID(), List.of(generateDevice(DEVICE_ID_1)));
|
||||
existingAccount.setBackupCredentialRequest(TestRandomUtil.nextBytes(32));
|
||||
createAccount(existingAccount);
|
||||
final Account secondAccount =
|
||||
generateAccount(e164, UUID.randomUUID(), UUID.randomUUID(), List.of(generateDevice(DEVICE_ID_1)));
|
||||
|
||||
reclaimAccount(secondAccount);
|
||||
|
||||
final Account reclaimed = accounts.getByAccountIdentifier(existingUuid).get();
|
||||
assertThat(reclaimed.getBackupCredentialRequest()).isEqualTo(existingAccount.getBackupCredentialRequest());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testReclaimAccount() {
|
||||
final String e164 = "+14151112222";
|
||||
|
||||
Reference in New Issue
Block a user