Don't run integrity checks when unlinked

This commit is contained in:
Fedor Indutny 2024-03-20 16:54:34 -07:00 committed by GitHub
parent 0f49d0d391
commit 79ed74f7b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -1324,7 +1324,7 @@ export async function startApp(): Promise<void> {
});
window.Whisper.events.on('unlinkAndDisconnect', () => {
void unlinkAndDisconnect();
drop(unlinkAndDisconnect());
});
window.Whisper.events.on('httpResponse499', () => {
@ -2928,6 +2928,14 @@ export async function startApp(): Promise<void> {
conversation.unset('senderKeyInfo');
});
// We use username for integrity check
const ourConversation =
window.ConversationController.getOurConversation();
if (ourConversation) {
ourConversation.unset('username');
window.Signal.Data.updateConversation(ourConversation.attributes);
}
// Then make sure outstanding conversation saves are flushed
await window.Signal.Data.flushUpdateConversationBatcher();

View file

@ -4,6 +4,7 @@
import pTimeout from 'p-timeout';
import * as Errors from '../types/errors';
import { isDone as isRegistrationDone } from '../util/registration';
import { getConversation } from '../util/getConversation';
import { MINUTE, DAY } from '../util/durations';
import { drop } from '../util/drop';
@ -69,6 +70,10 @@ class UsernameIntegrityService {
}
private async check(): Promise<void> {
if (!isRegistrationDone()) {
return;
}
await this.checkUsername();
await this.checkPhoneNumberSharing();
}