Skip to content

fix(core): Stop LRUMap.set from evicting when updating an existing key - #24813

Merged
andreiborza merged 2 commits into
developfrom
ab/fix-lru-map-set-eviction
Sep 29, 2026
Merged

andreiborza merged 2 commits into
developfrom
ab/fix-lru-map-set-eviction

Conversation

@andreiborza

Copy link
Copy Markdown
Member

What

LRUMap.set() no longer evicts another entry when it updates an existing key. The updated key also becomes the most recently used.

Why

When the map was full, an update to an existing key deleted the oldest entry. This silently removed live data.

Closes: #24791

Closes: #24791

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.18 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Profiling) 54.18 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31.08 kB - -
@sentry/react (incl. Tracing) 53.54 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB -0.01% -1 B 🔽
@sentry/svelte 29.26 kB - -
CDN Bundle 31.02 kB - -
CDN Bundle (incl. Tracing) 51.78 kB +0.01% +4 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.75 kB +0.01% +4 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74 kB - -
CDN Bundle (incl. Tracing, Replay) 89.37 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.34 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 95.53 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.5 kB +0.01% +6 B 🔺
CDN Bundle - uncompressed 91.66 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.05 kB +0.02% +18 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160 kB +0.02% +18 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.8 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.78 kB +0.01% +18 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.72 kB +0.01% +18 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.48 kB +0.01% +18 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.41 kB +0.01% +18 B 🔺
@sentry/nextjs (client) 55.78 kB +0.01% +2 B 🔺
@sentry/sveltekit (client) 51.6 kB +0.01% +1 B 🔺
@sentry/core/server 39.99 kB +0.01% +2 B 🔺
@sentry/core/browser 13.63 kB - -
@sentry/node 141.92 kB +0.02% +16 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.88 kB - -
@sentry/node - without tracing 90.94 kB +0.02% +17 B 🔺
@sentry/node - without channel injection 120.3 kB +0.01% +12 B 🔺
@sentry/aws-serverless 99.17 kB +0.01% +7 B 🔺
@sentry/cloudflare (withSentry) - minified 206.64 kB +0.02% +22 B 🔺
@sentry/cloudflare (withSentry) 514.04 kB +0.01% +29 B 🔺

View base workflow run

@andreiborza
andreiborza marked this pull request as ready for review September 29, 2026 08:59
@andreiborza
andreiborza merged commit e703acc into develop Sep 29, 2026
345 checks passed
@andreiborza
andreiborza deleted the ab/fix-lru-map-set-eviction branch September 29, 2026 09:59
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.

Fix LRUMap.set evicting an entry when updating an existing key

2 participants