From 3ff456a63d1c05128d69ec6cfbd12f07670fb347 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 7 Nov 2023 08:21:22 -0500 Subject: [PATCH] Prefer CDNs when subscribing to a new list Also, purging the cache of a list should not remove the compiled version of that list so that it keep being seen as cached, but obsolete. --- src/js/3p-filters.js | 3 +-- src/js/assets.js | 2 +- src/js/messaging.js | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/3p-filters.js b/src/js/3p-filters.js index ffef2fcf4..eec5bdd47 100644 --- a/src/js/3p-filters.js +++ b/src/js/3p-filters.js @@ -292,7 +292,7 @@ const renderWidgets = ( ) => { dom.cl.toggle('#buttonUpdate', 'active', updating); dom.cl.toggle('#buttonUpdate', 'disabled', updating === false && - qs$('#lists .listEntry.checked.obsolete:not(.toRemove)') === null + qs$('#lists .listEntry.checked.obsolete.cached:not(.toRemove)') === null ); dom.cl.toggle('#buttonPurgeAll', 'disabled', updating || qs$('#lists .listEntry.cached:not(.obsolete)') === null @@ -519,7 +519,6 @@ const onPurgeClicked = ev => { // An external filter list must not be marked as obsolete, they will // always be fetched anyways if there is no cached copy. dom.cl.add(liEntry, 'obsolete'); - dom.cl.remove(liEntry, 'cached'); if ( qs$(liEntry, 'input[type="checkbox"]').checked ) { renderWidgets(); diff --git a/src/js/assets.js b/src/js/assets.js index 29abfa54c..0ac203b86 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -1262,7 +1262,7 @@ async function diffUpdater() { } else if ( data.error ) { ubolog(`Diff updater: failed to update ${data.name} using ${data.patchPath}, reason: ${data.error}`); } else if ( data.status === 'nopatch-yet' || data.status === 'nodiff' ) { - ubolog(`Diff updater: Skip update of ${data.name} using ${data.patchPath}, reason: ${data.status}`); + ubolog(`Diff updater: skip update of ${data.name} using ${data.patchPath}, reason: ${data.status}`); assetCacheSetDetails(data.name, { writeTime: data.lastModified || 0 }); diff --git a/src/js/messaging.js b/src/js/messaging.js index fdec5667c..519af3a43 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -1633,7 +1633,6 @@ const onMessage = function(request, sender, callback) { case 'purgeCaches': for ( const assetKey of request.assetKeys ) { io.purge(assetKey); - io.remove(`compiled/${assetKey}`); } break;