Fix narrow race around generation of some ACI keys.

This commit is contained in:
Greyson Parrelli
2022-03-10 11:11:14 -05:00
parent 66f93e0d32
commit 80bfa103ab
3 changed files with 22 additions and 3 deletions

View File

@@ -296,8 +296,19 @@ public class ApplicationDependencyProvider implements ApplicationDependencies.Pr
throw new IllegalStateException("No PNI set!");
}
boolean needsPreKeyJob = false;
if (!SignalStore.account().hasAciIdentityKey()) {
SignalStore.account().generateAciIdentityKeyIfNecessary();
needsPreKeyJob = true;
}
if (!SignalStore.account().hasPniIdentityKey()) {
SignalStore.account().generatePniIdentityKeyIfNecessary();
needsPreKeyJob = true;
}
if (needsPreKeyJob) {
CreateSignedPreKeyJob.enqueueIfNeeded();
}