Open
Conversation
Collaborator
Author
|
@greptile review |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect/unstable streaming query status updates by ensuring multipart parts are fully read even when delivered across multiple ReadableStream chunks (e.g., partial network delivery), and adds regression tests for this scenario.
Changes:
- Add
readPartText()helper to robustly read multipart part bodies usingContent-Lengthand stream accumulation. - Update
StreamingAPImultipart parsing to usereadPartText()instead ofpart.text(). - Extend Playwright streaming mock and tests to simulate and validate split-chunk delivery of the
SessionCreatedpart.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/mockStreamingFetch.ts | Adds option to split the session multipart part across two chunks to simulate partial network delivery. |
| tests/suites/tenant/queryEditor/queryStatus.test.ts | Adds E2E coverage ensuring status reaches “Running” even when SessionCreated arrives split. |
| src/services/api/streamingPartReader.ts | Introduces readPartText() to accumulate multipart body bytes reliably. |
| src/services/api/streaming.ts | Switches multipart part reading from part.text() to readPartText(). |
| src/services/api/test/readPartText.test.ts | Adds unit tests covering single/multi-chunk and delayed chunk delivery for readPartText(). |
Collaborator
Author
|
@greptile review |
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.
Closes #3592
Note
Medium Risk
Changes how streaming multipart parts are decoded in
StreamingAPI, which can affect query streaming and status updates if the Content-Length handling is wrong. Risk is mitigated by size guards, fallback topart.text(), and new unit/e2e tests covering split/oversized/async chunk delivery.Overview
Improves streaming query chunk decoding by replacing
part.text()with a newreadPartTexthelper that reads exactlyContent-Lengthbytes from the part’sReadableStream, correctly handling bodies delivered across multiple chunks (with a 64MB cap and fallback topart.text()when length is missing/invalid).Adds coverage for partial network delivery: unit tests for
readPartText(multi-chunk, byte-by-byte, oversized chunk clamping, async delays) and a Playwright test plus mock enhancements to split the initialSessionCreatedmultipart part, ensuring streaming status reaches Running before completing.Written by Cursor Bugbot for commit 1406eef. This will update automatically on new commits. Configure here.
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ✨1
✨ New Tests (1)
Bundle Size: ✅
Current: 62.93 MB | Main: 62.93 MB
Diff: +2.28 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information