From 896737d098d329af1b44f6a93a145872a9086f96 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 26 Jun 2024 11:00:50 -0400 Subject: [PATCH] Fix race condition when loading redirect/scriptlet resources Related feedback: https://github.com/uBlockOrigin/uAssets/issues/23806#issuecomment-2190491767 --- src/js/storage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/storage.js b/src/js/storage.js index b26ff00c6..116348322 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -1008,12 +1008,12 @@ onBroadcast(msg => { ubolog('loadFilterLists() Start'); t0 = Date.now(); loadedListKeys.length = 0; - loadingPromise = Promise.all([ - this.getAvailableLists().then(lists => onFilterListsReady(lists)), - this.loadRedirectResources().then(( ) => { - ubolog(`loadFilterLists() Redirects/scriptlets ready at ${elapsed()}`); - }), - ]).then(( ) => { + loadingPromise = this.loadRedirectResources().then(( ) => { + ubolog(`loadFilterLists() Redirects/scriptlets ready at ${elapsed()}`); + return this.getAvailableLists(); + }).then(lists => { + return onFilterListsReady(lists) + }).then(( ) => { onDone(); }); return loadingPromise;