From b5f334e9e3748b41c26267f26a1003051ae6139b Mon Sep 17 00:00:00 2001 From: James Chien Date: Tue, 26 Jan 2021 18:20:22 +0800 Subject: [PATCH] Set prefetched preference before start migration Migration is subject to failures (e.g. httpError), and error out during migration causes the prefetch preference not set when it should be set. Move it before starting migration so that it is always set first when starting the migration that might fails during the process. Signed-off-by: James Chien --- src/app/shared/services/migration/migration.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/services/migration/migration.service.ts b/src/app/shared/services/migration/migration.service.ts index e71f1e968..2fc365987 100644 --- a/src/app/shared/services/migration/migration.service.ts +++ b/src/app/shared/services/migration/migration.service.ts @@ -38,8 +38,9 @@ export class MigrationService { migrate$(skip?: boolean) { const runMigrate$ = defer(() => - this.runMigrateWithProgressDialog(skip) + this.onboardingService.setHasPrefetchedDiaBackendAssets(true) ).pipe( + concatMap(() => this.runMigrateWithProgressDialog(skip)), concatMap(() => this.preferences.setBoolean(PrefKeys.TO_0_15_0, true)), concatMap(() => this.updatePreviousVersion()) ); @@ -61,7 +62,6 @@ export class MigrationService { }); await this.to0_15_0(); - await this.onboardingService.setHasPrefetchedDiaBackendAssets(true); dialogRef.close(); }