From 3f20122e5bc9364762c1b477f79f9b99e242d05b Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 11 Mar 2022 07:16:50 +1000 Subject: [PATCH] Avoid duplicate fullSync api calls (#716) --- common/src/services/sync.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/src/services/sync.service.ts b/common/src/services/sync.service.ts index cc512e501c..93611238bc 100644 --- a/common/src/services/sync.service.ts +++ b/common/src/services/sync.service.ts @@ -13,6 +13,7 @@ import { SendService } from "../abstractions/send.service"; import { SettingsService } from "../abstractions/settings.service"; import { StateService } from "../abstractions/state.service"; import { SyncService as SyncServiceAbstraction } from "../abstractions/sync.service"; +import { sequentialize } from "../misc/sequentialize"; import { CipherData } from "../models/data/cipherData"; import { CollectionData } from "../models/data/collectionData"; import { FolderData } from "../models/data/folderData"; @@ -71,6 +72,7 @@ export class SyncService implements SyncServiceAbstraction { await this.stateService.setLastSync(date.toJSON(), { userId: userId }); } + @sequentialize(() => "fullSync") async fullSync(forceSync: boolean, allowThrowOnError = false): Promise { this.syncStarted(); const isAuthenticated = await this.stateService.getIsAuthenticated();