Backend API has valid response, but Detox is not getting the response (with Flipper installed)
See original GitHub issueWhat happened?
I am running Detox on iOS, with backend (expressJS) running in localhost separately
I logged both the backend and frontend response body
When I run the detox test, the backend gave valid response body, but the frontend receives it undefined
, even though the statusCode is 200
When i run without detox test, the network request is working fine.
I am not sure what am I missing to make the sure the network request body is not missing along the way…
What was the expected behaviour?
When backend API gave valid response, the frontend should receive the same response
Was it tested on latest Detox?
- I have tested this issue on the latest Detox release and it still reproduces.
Did your test throw out a timeout?
- I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much.
Help us reproduce this issue!
Create a sample RN app, expressJS which returns some random response
Configure RN with detox and then have RN make network request to the expressJS app
Run the detox test
In what environment did this happen?
Detox version: 19.4.3 React Native version: 0.67 Node version: 16 Device model: iphone 12 iOS version: 15 macOS version: monterey Xcode version: 13.3.1 Test-runner (select one): jest-circus
Detox logs
Detox logs
paste logs here!
Device logs
no logs
More data, please!
No response
Issue Analytics
- State:
- Created a year ago
- Comments:25 (10 by maintainers)
This PR resolves the issue: https://github.com/wix/Detox/pull/3499 I’ll release a patch version soon.
We have the same problem, that when detox starts the app on the simulator none of the HTTP responses have a body and
JSON.parse('')
fails, so it’s not even a network error.When we write a detox test, that launches the app and wait a few seconds at first, we can manually close the app (really close by swiping away) and start the app again by clicking on it, everything starts to work and the test can run. This workaround is not possible with automatically terminate and relaunch the app. So this might be a hint, that the
launchApp(..)
makes the app start in a bad state with flipper, while starting the app by clicking on it not.We currently fixed it by commenting out
# use_flipper!(..)
, but we should better try the flipper downgrade.If you need more information, please reach out.