Skip to content

fix(cache): persist vary when updating sqlite cache entries#5109

Merged
mcollina merged 1 commit intonodejs:mainfrom
trivikr:sqlite-cache-store-update-vary
Apr 25, 2026
Merged

fix(cache): persist vary when updating sqlite cache entries#5109
mcollina merged 1 commit intonodejs:mainfrom
trivikr:sqlite-cache-store-update-vary

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented Apr 25, 2026

This relates to...

Fixes: #5108

Rationale

SqliteCacheStore#set() reuses an existing row for the same URL/method, but the UPDATE statement did not include vary. That meant an entry could transition from non-varying to varying in memory while the SQLite row still held NULL, allowing later lookups to match unrelated request headers.

Changes

  • update SqliteCacheStore's overwrite query to persist vary
  • pass serialized value.vary through the update path in set()

Features

N/A

Bug Fixes

Fixed SqliteCacheStore failing to update vary when overwriting an existing cache entry

Breaking Changes and Deprecations

N/A

Status

Assisted-by: openai:gpt-5.4

Assisted-by: openai:gpt-5.4
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.14%. Comparing base (94c9dea) to head (c177a2d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5109   +/-   ##
=======================================
  Coverage   93.14%   93.14%           
=======================================
  Files         110      110           
  Lines       35894    35896    +2     
=======================================
+ Hits        33432    33434    +2     
  Misses       2462     2462           

☔ 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.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 3a316f3 into nodejs:main Apr 25, 2026
60 of 61 checks passed
@trivikr trivikr deleted the sqlite-cache-store-update-vary branch April 25, 2026 06:08
@github-actions github-actions Bot mentioned this pull request May 1, 2026
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.

SqliteCacheStore updates an existing cache row without updating the vary column

3 participants