Skip to content

fix: use text response path for React Native fetches#970

Merged
stevensJourney merged 1 commit into
powersync-ja:mainfrom
VIVAAN-DHAWAN:codex/react-native-text-fetch-969
May 20, 2026
Merged

fix: use text response path for React Native fetches#970
stevensJourney merged 1 commit into
powersync-ja:mainfrom
VIVAAN-DHAWAN:codex/react-native-text-fetch-969

Conversation

@VIVAAN-DHAWAN
Copy link
Copy Markdown
Contributor

Fixes #969

Summary

  • Wrap ReactNativeRemote.fetch so every React Native HTTP request passes reactNative: { textStreaming: true }.
  • Add a small React Native vitest harness with react-native / react-native-fetch-api test aliases.
  • Cover non-streaming get() and post() calls so checkpoint and credential-style requests stay on the text response path in RN 0.85.
  • Add a patch changeset for @powersync/react-native.

Reproduction before fix

  • pnpm --filter @powersync/react-native test --run failed with 2 tests showing GET and POST fetch options did not include reactNative.textStreaming.

Validation after fix

  • pnpm --filter @powersync/react-native test --run -> 2 tests passed.
  • pnpm --filter @powersync/react-native build -> passed.
  • pnpm --filter @powersync/react-native test:exports -> no problems found.
  • pnpm exec prettier --check ...changed files... -> all matched files use Prettier style.
  • git diff --check -> passed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

🦋 Changeset detected

Latest commit: 31831d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@powersync/react-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

I could reproduce the issue and confirmed this fixed it on my end.

As mentioned in the issue, we should still consider other alternatives to this implementation of fetch in the future. For now, I think this is the quickest/simplest win with what seems to be no negative impact.

@stevensJourney stevensJourney merged commit 6830f4a into powersync-ja:main May 20, 2026
5 checks passed
@minhnhat165
Copy link
Copy Markdown

I hope this fix can be released soon. Expo SDK 56 is now stable, and I currently can’t test because I’m running into this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants