Skip to content

fix: preserve dump entries when loading TTL values - #422

Open
LucasLeao18 wants to merge 1 commit into
isaacs:mainfrom
LucasLeao18:fix/preserve-reusable-dump
Open

LucasLeao18 wants to merge 1 commit into
isaacs:mainfrom
LucasLeao18:fix/preserve-reusable-dump

Conversation

@LucasLeao18

Copy link
Copy Markdown

Loading a dump converts each entry.start in place from a portable Date.now() timestamp to a performance timestamp. Loading the same dump into another cache then makes its TTL entries stale.

Copy the per-entry options before converting the timestamp. The regression checks input preservation and reuse across two caches.

Fixes #421.

Validation (Node.js 24.15.0, Windows): The new regression fails before the fix and passes afterward. tshy and all six esbuild bundles build successfully. Full tap run: 19,373 assertions pass. Oxlint and Prettier checks pass. On Windows, an uncommitted local preload uses directory junctions for tap plugin setup; @tapjs/clock was installed only in the generated .tap plugin environment. No dependency/config changes are included.

AI assistance: this contribution was prepared with OpenAI Codex; the change and regression results were reviewed before submission.

This branch has not been deployed

No deployments
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.

load() mutates the caller's dump entries, so loading the same dump into a second cache makes every TTL entry stale

1 participant