-
Notifications
You must be signed in to change notification settings - Fork 577
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
lib/user-methods.js's performFetch API is unstable across platforms #2274
Comments
That test failed because the network request to github failed, not because it couldn't read the content type header. The bit about not getting the correct content type is the expected result. |
Okay - I might have been a little too quick in my conclusion. |
FYI: whatwg/fetch#878 |
I am sorry to report that we still have an issue with this implementation on Electron when called from the main process:
|
Moreover, we should add support for exponential backoff and retrying for all platforms. |
This issue went away as we merged with the Stich SDK and introduced the realm-network-transport package (https://github.com/realm/realm-js/tree/master/packages/realm-network-transport). |
Goals
We have to make a choice: Either the
performFetch
method of lib/user-methods.js should adhere to the fetch API, which means that we should be able to read header values from a response such asresponse.headers.get('Content-Type')
or we should simplify the way we call the method making less assumptions on the shape of the response object (I don't recommend the latter).In its current implementation
performFetch
performs very differently whether Realm JS is running on Node.js or in an environment withfetch
available.We currently have tests failing on master due to this discrepancy in behaviour across platforms.
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: