#4973·Detox

Android: network synchronization misses OkHttp clients created outside NetworkingModule (all traffic invisible on Expo SDK 56+)

Author: isilherCreated Sep 3, 2026Updated Sep 3, 2026

Describe the bug

NetworkIdlingResource monitors a single OkHttp Dispatcher — the one inside RN's NetworkingModule, captured once at registration. Modules that create their own clients through RN's OkHttpClientProvider are invisible to synchronization. The most impactful case: expo/fetch is the global fetch since Expo SDK 56, so on such apps all JS HTTP traffic bypasses the watched dispatcher. Detox performs taps/assertions while requests are in flight — e.g. tapping a button that is still disabled pending a server response.

Steps to reproduce

Expo SDK 56+ (RN 0.85+, bridgeless), any screen where a UI element enables after a fetch: Detox taps before the response lands. Instrumenting NetworkIdlingResource shows runningCalls() empty on the watched dispatcher throughout app traffic.

Two adjacent defects in the same code path: getHttpClient()!! can NPE under bridgeless (lazy TurboModules — the module may not exist at registration), and the dispatcher snapshot goes stale when the RN context is recreated.

Environment

  • Detox: 20.51.4
  • React Native: 0.86.2, new architecture (bridgeless)
  • Platform: Android

A fix is proposed in the linked pull request.