contactSync should depend on syncMessage.complete

This commit is contained in:
Fedor Indutny 2022-08-26 15:26:38 -07:00 committed by GitHub
parent 299044f89f
commit c42df6312e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 29 deletions

View file

@ -3070,6 +3070,7 @@ export default class MessageReceiver
const contactSync = new ContactSyncEvent(
Array.from(contactBuffer),
Boolean(contacts.complete),
envelope.receivedAtCounter
);
await this.dispatchAndWait(contactSync);

View file

@ -76,6 +76,7 @@ export class ErrorEvent extends Event {
export class ContactSyncEvent extends Event {
constructor(
public readonly contacts: ReadonlyArray<ModifiedContactDetails>,
public readonly complete: boolean,
public readonly receivedAtCounter: number
) {
super('contactSync');