Process manifest before persisting its version

This commit is contained in:
Fedor Indutny 2022-01-04 07:22:48 -08:00 committed by GitHub
parent 868092ac5f
commit 14861aff50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}