Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie chunking support #1975

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Cookie chunking support #1975

wants to merge 3 commits into from

Conversation

tusharpandey13
Copy link
Contributor

@tusharpandey13 tusharpandey13 commented Mar 18, 2025

Changes

This PR changes the cookie store/retrieve strategy to use cookie chunking on the session cookie.
Also fixed some warnings in some test files.

Write behaviour

  • When the session size is larger than 3500 bytes, it will be saved as multiple chunks, delimited by __index.
  • Else, a single __session cookie is stored.

Read behaviour

Read bhaviour is backwards compatible with v4.X.X and v3.X.X versions

Testing

PASSING

Test Files  10 passed (10)
      Tests  157 passed (157)
   Start at  17:11:08
   Duration  600ms (transform 249ms, setup 0ms, collect 852ms, tests 203ms, environment 1ms, prepare 462ms)

@tusharpandey13 tusharpandey13 requested a review from a team as a code owner March 18, 2025 11:43
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 98.05825% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.54%. Comparing base (9f2e29d) to head (c1f3f40).

Files with missing lines Patch % Lines
src/server/cookies.ts 97.67% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1975      +/-   ##
==========================================
+ Coverage   76.16%   77.54%   +1.38%     
==========================================
  Files          21       21              
  Lines        1523     1608      +85     
  Branches      242      259      +17     
==========================================
+ Hits         1160     1247      +87     
+ Misses        356      354       -2     
  Partials        7        7              

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

@tusharpandey13 tusharpandey13 changed the title chunked cookies implementation with tests, fixed some warnings in other tests related to await expect Cookie chunking support Mar 18, 2025
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.

3 participants