react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Axios Fails on RNW (Add support for useIncrementalUpdates in Networking Module)

Open stecrain opened this issue 7 years ago • 15 comments

Any http requests from a react native app which request progress updates will currently fail.

We currently use axios for http requests, and the library requests progress updates. https://github.com/axios/axios/blob/503418718f669fcc674719fd862b355605d7b41f/lib/adapters/xhr.js

stecrain avatar May 13 '19 22:05 stecrain

@stecrain Is this needed before our June 30 milestone?

kmelmon avatar May 14 '19 18:05 kmelmon

@kmelmon No, for now we can get our network requests working by monkey patching RCTNetworking.sendRequest to always pass down false for incrementalUpdates. https://microsoft.visualstudio.com/Xbox.Apps/_git/Xbox.Apps.Store.RNPrototype/pullrequest/3262449?_a=files&path=%2FApp.tsx

We don't have application logic that depends on this, a library that we use requests progress events so that it can fail early.

I am much more interested in issue #2466. Without something to fix that issue we will wind up consuming a fork of react-native-windwos to make progress on our prototyping.

stecrain avatar May 14 '19 18:05 stecrain

@harinikmsft, Partner(Xbox) has a use-case for this. So want to +1 it for the prioritization in Milestone 4.

"useIncrementalUpdates in Networking"

edit: We no longer have a use-case for this. We redesigned our code to not need this anymore.

namrog84 avatar Oct 17 '19 21:10 namrog84

useIncrementalUpdates is a parameter in RTCNetworking.sendRequest.

Implementation goes here: https://github.com/microsoft/react-native-windows/blob/master/vnext/ReactUWP/Modules/NetworkingModule.cpp#L111

And this assert should be removed: https://github.com/microsoft/react-native-windows/blob/master/vnext/ReactUWP/Modules/NetworkingModule.cpp#L245

marlenecota avatar Oct 31 '19 02:10 marlenecota

Per comment above about partner being unblocked, downgrading priority of this.

chrisglein avatar Jan 07 '20 02:01 chrisglein

is react-native-windows at all development ready? Axios is a standrad library that is present in most react projects and here it is not supported since almost one year. There should be section in readme what are the current limitations of this project compared to react native for ios/android.

lukago avatar Feb 09 '20 17:02 lukago

@marlenecota looks like Axios is a fundamental module and we should fix this sooner rather than later.

YuliKl avatar Feb 10 '20 19:02 YuliKl

Still an important bug, but we're told this is no longer immediately blocking for partners. Downgrading from 'must-have' but leaving as potential for 0.62

chrisglein avatar Apr 24 '20 01:04 chrisglein

Reflagging this for triage due to severity.

NickGerleman avatar Oct 25 '21 22:10 NickGerleman

Issue affects UWP http stack. Does not affect devmain stack.

Talking to Julio, devmain stack is very different currently, and cannot be easily ported. Convergence is a potential later project. Makes sense to fix uwp implementation separately in the meantime.

NickGerleman avatar Oct 26 '21 00:10 NickGerleman

Reflagging this for triage due to severity.

Can you provide more detail? Last update was from over a year ago.

chrisglein avatar Oct 28 '21 18:10 chrisglein

We forgot to implement a pretty simple callback and it breaks using the most popular http library in the JS ecosystem.

NickGerleman avatar Oct 29 '21 13:10 NickGerleman

Looks like there isn't new customer requests for this, is there any urgency to implement this?

asklar avatar Nov 01 '21 18:11 asklar

It's an issue that will hit many/most real projects out there. The determined folks can work around it (and several have, from the above comments), but we shouldn't be requiring folks to monkey-patch internal networking code to get correct enough behavior to use the defacto JS HTTP client.

Just from the significance, it feels like having a platform that advertises "Run your C-Sharp code here!", but you had a bug that meant Newtonsoft didn't work.

The specific issues looked like it was missing implementation of 30 LOC on other platforms, for something that people repeatedly hit.

NickGerleman avatar Nov 02 '21 14:11 NickGerleman

Incremental updates is not currently supported in Microsoft.ReactNative.

We will open the corresponding issue for follow up.

JunielKatarn avatar Feb 13 '22 03:02 JunielKatarn