Call refreshPreKeys on same cadence as rotateSignedPreKey
This commit is contained in:
parent
6e1916030d
commit
22fb69bbb7
2 changed files with 16 additions and 2 deletions
|
@ -326,13 +326,20 @@ export default class AccountManager extends EventTarget {
|
|||
async refreshPreKeys(uuidKind: UUIDKind): Promise<void> {
|
||||
return this.queueTask(async () => {
|
||||
const preKeyCount = await this.server.getMyKeys(uuidKind);
|
||||
log.info(`prekey count ${preKeyCount}`);
|
||||
log.info(
|
||||
`refreshPreKeys(${uuidKind}): Server prekey count is ${preKeyCount}`
|
||||
);
|
||||
if (preKeyCount >= 10) {
|
||||
return;
|
||||
}
|
||||
|
||||
const keys = await this.generateKeys(SIGNED_KEY_GEN_BATCH_SIZE, uuidKind);
|
||||
await this.server.registerKeys(keys, uuidKind);
|
||||
await this.confirmKeys(keys, uuidKind);
|
||||
|
||||
const updatedCount = await this.server.getMyKeys(uuidKind);
|
||||
log.info(
|
||||
`refreshPreKeys(${uuidKind}): Successfully updated; server count is now ${updatedCount}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue