Skip to content

XMLHttpRequest readyState 4 does not guarantee full response data #13408

@capagrisdesu

Description

@capagrisdesu

Problem Description

This merge may be problematic for many public libraries out there and new devs in React Native Windows that come from any other platform that uses XMLHttpRequest.
#10933

For example, I am using hls.js which uses on onreadystatechange which sets incremental steps to true. There is no documentation about what this is about and how to switch it off or how to handle incremental responses... This causes the library to fail because when readyState is 4, then will use the response to play content which is capped to 128kb.

I searched but I could not find any documentation and samples about incremental steps.

Steps To Reproduce

Any XMLHttpRequest request using onreadystatechange downloading a file greater than 128kb.

Expected Results

Incremental updates should be a featured that is disabled by default, not something enabled by design there because for most devs from any platform using XMLHttpRequest will be unaware of such behavior.

There should be documentation that states how incremental updates work and samples about how to use it along with onreadystatechange.

CLI version

13.6.6

Environment

System:
  OS: Windows 10 10.0.19045
  CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
  Memory: 15.35 GB / 31.68 GB
Binaries:
  Node:
    version: 22.3.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 3.6.4
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    Android NDK: 23.2.8568313
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-221.6008.13.2211.9477386
  Visual Studio:
    - 17.10.35004.147 (Visual Studio Community 2022)
    - 16.11.34931.43 (Visual Studio Professional 2019)
Languages:
  Java:
    version: 11.0.15
    path: /c/Program Files/Android/Android Studio/jbr/bin/javac
  Ruby:
    version: 3.1.3
    path: C:\Ruby31-x64\bin\ruby.EXE
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.2
    wanted: 0.74.2
  react-native-windows:
    installed: 0.74.7
    wanted: 0.74.7
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.74.3 is now available (your project is running on v0.74.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.74.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.2
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".

Community Modules

No response

Target Platform Version

None

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions