Fix race condition when loading redirect/scriptlet resources

Related feedback:
https://github.com/uBlockOrigin/uAssets/issues/23806#issuecomment-2190491767
This commit is contained in:
Raymond Hill 2024-06-26 11:00:50 -04:00
parent 6b349ca0ef
commit 896737d098
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 6 additions and 6 deletions

View File

@ -1008,12 +1008,12 @@ onBroadcast(msg => {
ubolog('loadFilterLists() Start'); ubolog('loadFilterLists() Start');
t0 = Date.now(); t0 = Date.now();
loadedListKeys.length = 0; loadedListKeys.length = 0;
loadingPromise = Promise.all([ loadingPromise = this.loadRedirectResources().then(( ) => {
this.getAvailableLists().then(lists => onFilterListsReady(lists)),
this.loadRedirectResources().then(( ) => {
ubolog(`loadFilterLists() Redirects/scriptlets ready at ${elapsed()}`); ubolog(`loadFilterLists() Redirects/scriptlets ready at ${elapsed()}`);
}), return this.getAvailableLists();
]).then(( ) => { }).then(lists => {
return onFilterListsReady(lists)
}).then(( ) => {
onDone(); onDone();
}); });
return loadingPromise; return loadingPromise;