From eb871ae55878f1087c1b05ae8ce19d84f8362acf Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 21 Sep 2019 19:24:47 -0400 Subject: [PATCH] Fix regression in selfie destruction code Related commit: - https://github.com/gorhill/uBlock/commit/915687fddb23087b64e22e63d88f4d9e8764c962#diff-73ef8c4664f2ec8c02320d50b2908efdR1100-R1113 Since selfie destruction is now deferred so as to coallesce burst of call to destroy(), the selfie load code must mind whether there is a pending destruction in order to decide whether the selfie can be safely loaded. Related feedback: - https://github.com/gorhill/uBlock/commit/23c4c80136ba4974a6444488ef8162ba75b0cb84#commitcomment-35179834 --- src/js/background.js | 4 ++-- src/js/storage.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index 5c955d880..08c897b29 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -140,8 +140,8 @@ const µBlock = (( ) => { // jshint ignore:line // Read-only systemSettings: { - compiledMagic: 19, // Increase when compiled format changes - selfieMagic: 19, // Increase when selfie format changes + compiledMagic: 20, // Increase when compiled format changes + selfieMagic: 20, // Increase when selfie format changes }, restoreBackupSettings: { diff --git a/src/js/storage.js b/src/js/storage.js index f1cdfaf05..76ae8d9c4 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -1052,6 +1052,10 @@ }; const load = async function() { + if ( destroyTimer !== undefined ) { + return Promise.resolve(false); + } + return Promise.all([ µb.assets.get('selfie/main').then(details => { if (