fix: enforce 1 MiB minimum for maxInflightBytes#129
Open
infiniteregrets wants to merge 2 commits intomainfrom
Open
fix: enforce 1 MiB minimum for maxInflightBytes#129infiniteregrets wants to merge 2 commits intomainfrom
infiniteregrets wants to merge 2 commits intomainfrom
Conversation
Greptile OverviewGreptile SummaryChanged validation behavior for Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant RetryAppendSession
participant S2Error
Client->>RetryAppendSession: new RetryAppendSession(options)
alt maxInflightBytes provided
RetryAppendSession->>RetryAppendSession: Get maxInflightBytes from options
else maxInflightBytes not provided
RetryAppendSession->>RetryAppendSession: Use DEFAULT_MAX_INFLIGHT_BYTES (3 MiB)
end
alt maxInflightBytes < MIN_MAX_INFLIGHT_BYTES (1 MiB)
RetryAppendSession->>S2Error: throw new S2Error with origin: "sdk"
S2Error-->>Client: Error thrown
else maxInflightBytes >= MIN_MAX_INFLIGHT_BYTES
RetryAppendSession->>RetryAppendSession: Set maxQueuedBytes = maxInflightBytes
RetryAppendSession-->>Client: Session created successfully
end
|
Comment on lines
+653
to
+658
| if (maxInflightBytes < MIN_MAX_INFLIGHT_BYTES) { | ||
| throw new S2Error({ | ||
| message: `maxInflightBytes must be at least ${MIN_MAX_INFLIGHT_BYTES}`, | ||
| origin: "sdk", | ||
| }); | ||
| } |
There was a problem hiding this comment.
this change will break the existing test in appendSession.test.ts:214 which uses maxInflightBytes: 100
the test will need to be updated to use a value >= 1 MiB or to expect this error
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/streamstore/src/lib/retry.ts
Line: 653:658
Comment:
this change will break the existing test in `appendSession.test.ts:214` which uses `maxInflightBytes: 100`
the test will need to be updated to use a value >= 1 MiB or to expect this error
How can I resolve this? If you propose a fix, please make it concise.
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
S2Errorwithorigin: "sdk"ifmaxInflightBytes < 1 MiBinstead of silently clampingValidationError, session/append.rs:118-119)Test plan
🤖 Generated with Claude Code