Do not make changes to the index's primary key

- Values should not be modified in `indexdb.js`
pull/4616/head
awsr 2026-02-03 13:15:21 -08:00
parent 915bcab3c2
commit c4de8fb1cc
No known key found for this signature in database
1 changed files with 1 additions and 4 deletions

View File

@ -185,10 +185,7 @@ async function idbFolderCleanup(keepSet, folder, signal) {
throw new Error('IndexedDB cleaning function must be told the current active folder');
}
// Use range query to match folder and all its subdirectories
const folderNormalized = folder.replace(/\/+/g, '/').replace(/\/$/, '');
const range = IDBKeyRange.bound(folderNormalized, `${folderNormalized}\uffff`, false, true);
let removals = new Set(await idbGetAllKeys('folder', range));
let removals = new Set(await idbGetAllKeys('folder', folder));
removals = removals.difference(keepSet); // Don't need to keep full set in memory
const totalRemovals = removals.size;
if (signal.aborted) {