Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK52] [expo/fetch] Unwanted response data buffering #32950

Open
matthiasbayer opened this issue Nov 15, 2024 · 2 comments
Open

[SDK52] [expo/fetch] Unwanted response data buffering #32950

matthiasbayer opened this issue Nov 15, 2024 · 2 comments
Assignees
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@matthiasbayer
Copy link

matthiasbayer commented Nov 15, 2024

Minimal reproducible example

https://github.com/matthiasbayer/expo-fetch-buffer-bug

What platform(s) does this occur on?

iOS

Where did you reproduce the issue?

in a development build, in Expo Go

Summary

Calling fetch to read a streamed response seems to buffer the response messages up to around ~500 characters before actually returning the first chunk of the response.

image

Each dot is one message streamed chunk returned from the http endpoint. Clearly visible, the first few hundred characters are buffered together somewhere. This is unwanted behavior.

Expected behavior: each chunk is rendered immediately.

Environment

expo-env-info 1.2.1 environment info:
    System:
      OS: macOS 15.0.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.11.0 - ~/Library/Caches/fnm_multishells/7155_1731685240576/bin/node
      npm: 10.2.4 - ~/Library/Caches/fnm_multishells/7155_1731685240576/bin/npm
      Watchman: 2024.11.11.00 - /opt/homebrew/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
    IDEs:
      Android Studio: 2023.1 AI-231.9392.1.2311.11255304
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    Expo Workflow: managed

Expo Doctor Diagnostics

Enabled experimental React Native Directory checks. Unset the EXPO_DOCTOR_ENABLE_DIRECTORY_CHECK environment variable to disable this check.
✔ Check package.json for common issues
✔ Check Expo config for common issues
✔ Check native tooling versions
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check if the project meets version requirements for submission to app stores
✔ Check for common project setup issues
✔ Check dependencies for packages that should not be installed directly
✔ Check npm/ yarn versions
✔ Check for issues with Metro config
✔ Validate packages against React Native Directory package metadata
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!
@matthiasbayer matthiasbayer added the needs validation Issue needs to be validated label Nov 15, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Nov 15, 2024
@Kudo Kudo self-assigned this Nov 19, 2024
@matthiasbayer
Copy link
Author

Just verified that this is still happening with the latest expo version 52.0.9

@matthiasbayer matthiasbayer changed the title [SDK52] [expo/fetch] Received data not rendered immediately [SDK52] [expo/fetch] Unwanted response data buffering Nov 21, 2024
@matthiasbayer
Copy link
Author

@Kudo I just attached a minimal reproduction example.

This looks to me like there is some buffer in the native layer that holds back data before forwarding it to the JS context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants