From 000d15d8abba5df3dde04c5b863faeab50617aa7 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 2 Sep 2017 07:08:07 -0400 Subject: [PATCH] code review: try to remove not found keys from storage.local --- platform/webext/vapi-cachestorage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/webext/vapi-cachestorage.js b/platform/webext/vapi-cachestorage.js index 9420832f5..180a8c32c 100644 --- a/platform/webext/vapi-cachestorage.js +++ b/platform/webext/vapi-cachestorage.js @@ -142,7 +142,9 @@ vAPI.cacheStorage = (function() { if ( !db ) { return callback(); } var transaction = db.transaction(STORAGE_NAME); transaction.oncomplete = transaction.onerror = function() { + // TODO: remove once storage.local is clean if ( notfoundKeys.size === 0 ) { + vAPI.storage.remove(keys); return callback(store); } maybeMigrate(Array.from(notfoundKeys), store, callback);