lib/user-methods.js's performFetch API is unstable across platforms
See original GitHub issueGoals
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 as response.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 with fetch available.
We currently have tests failing on master due to this discrepancy in behaviour across platforms.
Version of Realm and Tooling
- Realm JS SDK Version: 2.24.0
- Node or React Native: Both - but mostly React Native and Electron exhibits regressions.
- Client OS & Version: N/A
- Which debugger for React Native: N/A
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
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).