MOU — Marvellous Onyema UgochukwuMarvellous Onyema
All posts
Mobile/12 Nov 2026/4 min read

The offline banner that lied

A phone can be on Wi-Fi and still be offline. Here is how I stopped the MBS app from pretending otherwise.

The bug report was simple: “The app says I’m online, but nothing loads.”

On the surface, the app was doing what it was told. NetInfo reported a connected Wi-Fi network. The operating system agreed. But the school API was not reachable from that network, so every request failed while the UI insisted everything was fine.

Why the signal was wrong

NetInfo answers a device question: is there a network interface? It does not answer the product question: can this app reach the school’s server? A captive portal, a dead route, or a Wi-Fi network with no upstream can all look “connected”.

The fix

I made connectivity the product of two signals: the device radio and the API client. The axios interceptor now emits network:api-offline when a request never reaches the server, and network:api-online on any HTTP response. A successful round trip is proof; a transport failure is a signal.

  • Combine deviceOnline with apiReachable instead of trusting either alone.
  • While offline, probe the API every 15 seconds so the banner can clear itself.
  • Clear the banner only when the server answers again.
  • Treat any HTTP response, including a 4xx or 5xx, as proof the API is reachable.

What users see

The banner now means what it says. It appears when the school server is unreachable, even on strong Wi-Fi, and it clears itself when the server comes back. The app no longer asks the user to debug a network problem the UI refused to admit.