Skip to content

fix 🐛: fix regexp for cookie parsing#4527

Merged
gogusarov merged 2 commits intomainfrom
grigory.gusarov/RUM-16051
Apr 28, 2026
Merged

fix 🐛: fix regexp for cookie parsing#4527
gogusarov merged 2 commits intomainfrom
grigory.gusarov/RUM-16051

Conversation

@gogusarov
Copy link
Copy Markdown
Contributor

@gogusarov gogusarov commented Apr 27, 2026

Motivation

Currently used helper does not take into account the parsing of cookies which have empty values (eg "foo=; hello=world") which leads to several problems:

  1. sdk not starting due to having a corrupt cookie (cookie is a default session strategy and we check if this strategy is available in areCookiesAuthorized by tryint to set a test cookie value & then read from this cookie; this check will fail if empty cookie goes before the test cookie)
  2. sdk reporting incorrect cookie values

Changes

Fixed common utility function, updated corresponding unit test

Test instructions

https://regex101.com/r/3K03iT/1 - buggy behavior
https://regex101.com/r/3K03iT/2 - behavior after fix

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@gogusarov gogusarov requested a review from a team as a code owner April 27, 2026 15:18
@datadog-prod-us1-3
Copy link
Copy Markdown

datadog-prod-us1-3 Bot commented Apr 27, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 85.71%
Overall Coverage: 77.01% (-0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c4c65b3 | Docs | Datadog PR Page | Give us feedback!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@mormubis mormubis left a comment

Choose a reason for hiding this comment

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

Can you make a regression test?

@gogusarov gogusarov force-pushed the grigory.gusarov/RUM-16051 branch from d635188 to ea56696 Compare April 27, 2026 16:02
@gogusarov gogusarov force-pushed the grigory.gusarov/RUM-16051 branch from ea56696 to 9685831 Compare April 27, 2026 16:04
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 27, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 179.27 KiB 179.26 KiB -10 B -0.01%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.65 KiB 56.67 KiB +20 B +0.03%
Rum Slim 135.11 KiB 135.10 KiB -12 B -0.01%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0041 0.0061 +48.78%
RUM - add action 0.0148 0.0175 +18.24%
RUM - add error 0.0147 0.0139 -5.44%
RUM - add timing 0.0029 0.0036 +24.14%
RUM - start view 0.0136 0.0127 -6.62%
RUM - start/stop session replay recording 0.0008 0.0007 -12.50%
Logs - log message 0.0205 0.0177 -13.66%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.59 KiB 31.38 KiB -223 B
RUM - add action 105.36 KiB 98.98 KiB -6.39 KiB
RUM - add timing 32.19 KiB 32.15 KiB -40 B
RUM - add error 100.26 KiB 102.42 KiB +2.17 KiB
RUM - start/stop session replay recording 32.95 KiB 32.75 KiB -210 B
RUM - start view 497.39 KiB 490.56 KiB -6.83 KiB
Logs - log message 96.01 KiB 102.35 KiB +6.34 KiB

🔗 RealWorld

@gogusarov
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@gogusarov gogusarov requested a review from mormubis April 28, 2026 10:24
@gogusarov gogusarov merged commit 70bbd0e into main Apr 28, 2026
21 checks passed
@gogusarov gogusarov deleted the grigory.gusarov/RUM-16051 branch April 28, 2026 11:04
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants