Skip to content

fix: preserve cleanup list links across TTL expiry - #510

Merged
avoidwork merged 1 commit into
avoidwork:masterfrom
feritcemkahraman:fix/cleanup-expiry-links
Oct 21, 2026
Merged

avoidwork merged 1 commit into
avoidwork:masterfrom
feritcemkahraman:fix/cleanup-expiry-links

Conversation

@feritcemkahraman

Copy link
Copy Markdown
Contributor

Description

When an item reaches its TTL between cleanup's removal pass and its list rebuild, the rebuild drops it from the list but leaves it in items and size. A subsequent evict() then throws. Remove the redundant rebuild: cleanup already maintains the list through #unlink().

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

Added a deterministic clock regression that fails before the fix and checks retained list pointers and subsequent eviction. All 173 unit tests pass; Oxlint, formatting of the changed files, and Rollup's CJS/ESM/minified builds pass.

npm run lint still reports formatting in six unchanged files (three benchmarks, two distribution files, and rollup.config.js). Built files were not committed. The multi-Node/browser matrix was not run locally.

Coverage

  • 100% line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with 100% line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

@avoidwork
avoidwork merged commit 30397d7 into avoidwork:master Oct 21, 2026
4 checks passed
@avoidwork avoidwork mentioned this pull request Oct 21, 2026
6 of 12 tasks
@avoidwork

Copy link
Copy Markdown
Owner

This is 13.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants