fix(fetch): align Blob snapshot semantics#54
Conversation
|
Warning Review limit reached
More reviews will be available in 49 minutes and 44 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughFixes ChangesBlob Byte Snapshot Semantics Fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/src/fetch/blob.native.dart`:
- Around line 54-63: The stream method uses async* syntax which defers the
chunkSize validation until the stream is subscribed to, breaking callers
expecting synchronous validation. Split the method into two parts: make the
public stream method a regular synchronous method that validates the chunkSize
parameter immediately, then create a private async* generator method (such as
_streamGenerator) that contains the yield and await for logic. Have the public
stream method perform the validation first, then return the result of calling
the private generator method to preserve eager validation while keeping the
streaming logic deferred.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5c861ed6-d8ab-4252-adad-ee448762e956
📒 Files selected for processing (4)
CHANGELOG.mdlib/src/fetch/blob.js.dartlib/src/fetch/blob.native.darttest/blob_test.dart
Type
Fix
Summary
Blobparts at construction forUint8List,ByteBuffer,ByteData, andList<int>inputs.Blob.arrayBuffer(),Blob.bytes(), and streamed chunks so callers cannot mutate Blob backing.Notes
Blobbehavior from bug(fetch): audit Blob snapshot semantics #53.Body extends Blobrefactor from refactor(fetch): make Body extend platform Blob and implement Stream #50 / refactor(fetch): make Body extend Blob #51. Once this lands,Bodycan be revisited against the corrected Blob baseline.Validation
dart format --output=none --set-exit-if-changed .dart analyzedart test -p vm -p node -p chromeCloses #53
Summary by CodeRabbit
Bug Fixes
Tests