2

We've spent a lot of time trying to debug this issue with no success.

When we compile our React Native Android app in release mode the HTTP requests are taking (what seems to be) 90 seconds before the promises are returned. We believe this may only affect POST, PUT and PATCH methods not GET for some reason.

We cannot reproduce this issue in an emulator either.

We have checked the server logs and the requests are being received instantly.

We have 3 client environments:

  • Development (NO IPV6 support)
  • Staging (with IPV6 support)
  • Production (with IPV6 support)

There is plenty of documented issues around the Native Android HTTP issues, especially around IPV6 which is our best guess at this point for our issue.

We have tried both axios and fetch and the same issue occurs.

We have followed the suggestions in this thread (to force IPV4 preference):

https://gist.github.com/danmaas/c60af5fed9f55d2bc616ce302696540d#file-coreplaneokhttpclientfactory-java

We have also switched out okhttp4 for okhttp5-alpha-10 as per these instructions

How to implement okhttp 5.0.0 in react native module

But neither solution solve our problem.

We're completely stumped why this is only effecting release builds and not debug nor IPV6 enabled servers.

Anthony Main
  • 6,039
  • 12
  • 64
  • 89
  • It looks very much like something blocking on something that is not happening, and the response going out after a timeout. At the very least have a packet capture to see if e.g. a DNS request goes out and is never answered... – Bruno Rohée Jan 31 '23 at 18:40
  • Try OkHttp 5.0.0-alpha.11? That enables fast fallback by default. – Jesse Wilson Feb 01 '23 at 02:14
  • We've stripped the code back to bare bones Fetch calls. Tried Okhttp5. Debugged with the backend team to ensure requests are being returned timely. Completely stumped. Can only assume it's a packet routing issue at this point – Anthony Main Feb 14 '23 at 18:18

0 Answers0