Flush last conversation message save on shutdown

This commit is contained in:
Fedor Indutny 2022-04-12 11:16:58 -07:00 committed by GitHub
parent 0ccbf5e4bd
commit 42108c9ca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 8 deletions

View file

@ -3133,8 +3133,10 @@ function removeUnprocessedSync(id: string | Array<string>): void {
return;
}
// This can happen normally due to flushing of `cacheRemoveBatcher` in
// MessageReceiver.
if (!id.length) {
throw new Error('removeUnprocessedSync: No ids to delete!');
return;
}
assertSync(batchMultiVarQuery(db, id, removeUnprocessedsSync));