From 14861aff50c12e557ef61e3e5bc81a7fb3001562 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 4 Jan 2022 07:22:48 -0800 Subject: [PATCH] Process manifest before persisting its version --- ts/services/storage.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/services/storage.ts b/ts/services/storage.ts index 1077751fd79..73103f86b1d 100644 --- a/ts/services/storage.ts +++ b/ts/services/storage.ts @@ -1046,6 +1046,8 @@ async function sync( } const localManifestVersion = manifestFromStorage || 0; + + log.info(`storageService.sync: fetching ${localManifestVersion}`); manifest = await fetchManifest(localManifestVersion); // Guarding against no manifests being returned, everything should be ok @@ -1064,9 +1066,12 @@ async function sync( `storageService.sync: manifest versions - previous: ${localManifestVersion}, current: ${version}` ); + const hasConflicts = await processManifest(manifest); + + log.info(`storageService.sync: storing new manifest version ${version}`); + window.storage.put('manifestVersion', version); - const hasConflicts = await processManifest(manifest); if (hasConflicts && !ignoreConflicts) { await upload(true); }