Open capagrisdesu opened 5 months ago
@capagrisdesu To clarify, is this not the behavior on other React Native platforms (iOS, Android...)?
At a first glance, this seems to happen by design for any React Native platform. See https://github.com/facebook/react-native/blob/v0.74.3/packages/react-native/Libraries/Network/XMLHttpRequest.js#L523
I think that is not what I would call a good question since that seems to be focused on other platforms. A good question to me is more like... If that is the design of the XMLHttpRequest how do files greater than 128kb are downloaded incrementally in RN Windows? You are the one to answer that and provide samples about how is done or maybe this requires a fix because if you were to look at the Web API standards of XMLHttpRequest you can see that readyState 4 guarantees that the full file is delivered.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState
So the question that your team should think about is how you get a file larger than 128kb using XMLHttpRequest and having defined a onreadystatechange function to the request.
I guess that also I could say that I do not know the answer to your question. But his issue attempts to shed light on how this incremental is supposed to comply with the Web API standards of XMLHttpRequest and readyState 4. So I would hope that you do know the answer for it and explain what may be obvious to you.
I guess that also I could say that I do not know the answer to your question. But his issue attempts to shed light on how this incremental is supposed to comply with the Web API standards of XMLHttpRequest and readyState 4. So I would hope that you do know the answer for it and explain what may be obvious to you.
Not being involved in React Native for non-Windows platforms, I also do not know the answer. If this the by-design React Native behavior, then this issue is best to bring up with the Meta team and the upstream repository.
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. https://github.com/microsoft/react-native-windows/pull/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
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