A few small bugfixes

This commit is contained in:
Scott Nonnenberg 2020-10-30 10:56:03 -07:00 committed by GitHub
parent cd9aee84f5
commit 05f905fd10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 52 additions and 44 deletions

View file

@ -55,7 +55,7 @@ declare global {
eventType?: string | number;
groupDetails?: any;
groupId?: string;
messageRequestResponseType?: number;
messageRequestResponseType?: number | null;
proto?: any;
read?: any;
reason?: any;
@ -65,8 +65,8 @@ declare global {
source?: any;
sourceUuid?: any;
stickerPacks?: any;
threadE164?: string;
threadUuid?: string;
threadE164?: string | null;
threadUuid?: string | null;
storageServiceKey?: ArrayBuffer;
timestamp?: any;
typing?: any;
@ -195,9 +195,6 @@ class MessageReceiverInner extends EventTarget {
maxSize: 30,
processBatch: this.cacheRemoveBatch.bind(this),
});
// We always process our cache before any websocket message
this.pendingQueue.add(async () => this.queueAllCached());
}
static stringToArrayBuffer = (string: string): ArrayBuffer =>
@ -217,6 +214,9 @@ class MessageReceiverInner extends EventTarget {
return;
}
// We always process our cache before processing a new websocket message
this.pendingQueue.add(async () => this.queueAllCached());
this.count = 0;
if (this.hasConnected) {
const ev = new Event('reconnect');