Skip to content

Commit ec8deaa

Browse files
committed
fix(sessions): prune stale entries independently of maxEntries gate
Fixes #103956 The load-time stale-entry pruning in `loadSessionStore()` was gated by entry count exceeding `maxEntries`, causing `pruneAfter` to be silently ignored when the store was under the limit. Remove the entry-count gate so that `pruneStaleEntries` runs whenever mode is `"enforce"`, matching the pattern already established in `applyEnforcedMaintenance()`. Changes: - Remove `&& beforeCount > maintenance.maxEntries` condition from pruning block - Keep capping step gated by `shouldRunSessionEntryMaintenance` as before - No behavioral change to capping logic
1 parent 070b045 commit ec8deaa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/config/sessions/store-load.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export function loadSessionStore(
438438
const beforeCount = Object.keys(store).length;
439439
let pruned = 0;
440440
let capped = 0;
441-
if (maintenance.mode === "enforce" && beforeCount > maintenance.maxEntries) {
441+
if (maintenance.mode === "enforce") {
442442
const preserveSessionKeys = collectSessionMaintenancePreserveKeys();
443443
pruned = pruneStaleEntries(store, maintenance.pruneAfterMs, {
444444
log: false,

0 commit comments

Comments
 (0)