From 5f6cf4a6de066bf2a7d4544a113919d84da8873e Mon Sep 17 00:00:00 2001 From: Bauke Date: Tue, 4 Jul 2023 19:09:20 +0200 Subject: [PATCH] Fix an issue with the migration test failing intermittently. --- source/storage/exports.ts | 2 +- source/storage/migrations/migrations.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/storage/exports.ts b/source/storage/exports.ts index e9ff4eb..24d38ab 100644 --- a/source/storage/exports.ts +++ b/source/storage/exports.ts @@ -1,4 +1,4 @@ -import {createValue} from "@holllo/webextension-storage"; +import {createValue, type Value} from "@holllo/webextension-storage"; import browser from "webextension-polyfill"; import {Data, Feature} from "./enums.js"; import {collectHideTopicsData} from "./hide-topics.js"; diff --git a/source/storage/migrations/migrations.ts b/source/storage/migrations/migrations.ts index 4fbcdda..d709944 100644 --- a/source/storage/migrations/migrations.ts +++ b/source/storage/migrations/migrations.ts @@ -50,6 +50,7 @@ export const migrations: Array> = [ await version.save(); const enabledFeatures = await fromStorage(Data.EnabledFeatures); + enabledFeatures.value.clear(); for (const [key, value] of Object.entries(data.features)) { if (value) { const snakeCasedKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();