Skip to content

fix(cache): skip expired entries when searching sqlite cache#5047

Draft
deepview-autofix wants to merge 1 commit intonodejs:mainfrom
deepview-autofix:deepview/5ae1307df2
Draft

fix(cache): skip expired entries when searching sqlite cache#5047
deepview-autofix wants to merge 1 commit intonodejs:mainfrom
deepview-autofix:deepview/5ae1307df2

Conversation

@deepview-autofix
Copy link
Copy Markdown
Contributor

In #findValue, when iterating cached values sorted by deleteAt ASC, encountering an expired entry caused an immediate return undefined. This meant a valid, non-expired cache entry was missed whenever an expired entry existed for the same URL and method (for example when vary produced multiple rows). Skip expired entries with continue so the search keeps looking for a match.

In `#findValue`, when iterating cached values sorted by `deleteAt ASC`,
encountering an expired entry caused an immediate `return undefined`.
This meant a valid, non-expired cache entry was missed whenever an
expired entry existed for the same URL and method (for example when
`vary` produced multiple rows). Skip expired entries with `continue` so
the search keeps looking for a match.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: DeepView Autofix <276251120+deepview-autofix@users.noreply.github.com>
Co-Authored-By: Nikita Skovoroda <chalkerx@gmail.com>
Signed-off-by: Nikita Skovoroda <chalkerx@gmail.com>
@deepview-autofix deepview-autofix marked this pull request as draft April 16, 2026 19:18
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.03%. Comparing base (d2e8178) to head (9c7776e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5047   +/-   ##
=======================================
  Coverage   93.03%   93.03%           
=======================================
  Files         110      110           
  Lines       35793    35793           
=======================================
  Hits        33299    33299           
  Misses       2494     2494           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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