Clear verification sessionId after registration/changeNumber

Fixes #1882
This commit is contained in:
AsamK committed 2025-12-05 21:28:36 +01:00
1 parent ad2338b898
commit fca4d7459c
2 files changed
+8

No files matched your search

@@ -315,6 +315,7 @@ public class AccountHelper {
Utils.mapKeys(pniRegistrationIds, Object::toString))));
});
account.clearSessionId();
final var updatePni = PNI.parseOrThrow(result.first().getPni());
if (updatePni.equals(account.getPni())) {
logger.debug("PNI is unchanged after change number");
@@ -376,6 +376,7 @@ public class SignalAccount implements Closeable {
trustSelfIdentity(ServiceIdType.ACI);
trustSelfIdentity(ServiceIdType.PNI);
getKeyValueStore().storeEntry(lastRecipientsRefresh, null);
clearSessionId();
}
public void initDatabase() {
@@ -1485,6 +1486,12 @@ public class SignalAccount implements Closeable {
keyValueStore.storeEntry(verificationSessionId, sessionId);
}
public void clearSessionId() {
final var keyValueStore = getKeyValueStore();
keyValueStore.storeEntry(verificationSessionNumber, null);
keyValueStore.storeEntry(verificationSessionId, null);
}
public void setEncryptedDeviceName(final String encryptedDeviceName) {
this.encryptedDeviceName = encryptedDeviceName;
save();