fix: Use arrayBuffer instead of blob when memoizing responses#442
Merged
angeloashmore merged 1 commit intoApr 2, 2026
Merged
Conversation
lihbr
approved these changes
Apr 2, 2026
lihbr
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you so much for taking the time to open a PR! 💙
angeloashmore
approved these changes
Apr 2, 2026
angeloashmore
left a comment
Member
There was a problem hiding this comment.
Looks good to me too! Thanks for the fix. 🙂
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.
Resolves: React native compatibility
Description
The react native blob implementation is apparently a bit lacking. The memoization introduced in #437 is using some functions that do not exist in the react native blob.
Resulting in the following errors:
This change uses the
response.arrayBuffer()combined withTextEncoder.Checklist
Preview
How to QA 1
Note
Medium Risk
Changes the core
request()deduplication/memoization path to buffer bodies asArrayBuffer, which could affect response decoding and memory usage across all callers. Risk is moderate because it touches shared HTTP plumbing but is a localized behavioral swap.Overview
Fixes response memoization to be React Native compatible by buffering deduplicated responses using
response.arrayBuffer()instead ofresponse.blob().memoizeResponse()now reconstructstext()/json()viaTextDecoder, exposesarrayBuffer(), and recreatesblob()from the buffered bytes;WriteClient.fetchForeignAsset()is updated to buildFileobjects from anArrayBufferrather than aBlob.Written by Cursor Bugbot for commit 71c6c7e. This will update automatically on new commits. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩