Repository navigation
fix(compression): avoid regex for repeated literal blocks - #14633
Merged
diegosouzapw merged 2 commits intoSep 24, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
Owner
|
Nice fix — this lines up with the project's existing regex-size guardrails, and the guarded-RegExp test (asserting no RegExp is ever compiled from the block) is a clean way to prove it structurally. Before merging, could you add a changelog fragment under |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The session-dedup compressor now counts repeated text blocks with literal string scanning instead of compiling each block as a regular expression. Large memory or JSON-like blocks can no longer trip V8's
Regular expression too largelimit while the existing dedup behavior stays intact.Test plan
DISABLE_SQLITE_AUTO_BACKUP=true node --max-old-space-size=8192 --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit tests/unit/compression/session-dedup.test.ts tests/unit/compression/session-dedup-memory-7849.test.ts tests/unit/compression/session-dedup-intra-message-6467.test.ts