Skip to content

Missing EXPO_PUBLIC_API_BASE_URL is treated as "offline" and queues mutations that can never sync #155

Description

@Muawiya-contact

Problem
An unset API base URL throws ApiError(0, ...), and isOffline() treats any status === 0 as a network failure. So a build shipped without the env var doesn’t fail loudly — every request looks “offline”: the banner pins on, load() falls back to empty/cached state, and every like/save/topic/learn is enqueued into a durable queue that can never flush.

Evidencemobile/src/api/client.ts (ApiError(0, 'EXPO_PUBLIC_API_BASE_URL is not set') and the network-failure ApiError(0, ...) share status 0); mobile/src/services/remoteProgressRepository.ts isOffline(). isApiConfigured() and isSupabaseConfigured exist but are never consumed by the UI.

Impact — A misconfigured OTA/build degrades to a permanently-“offline”, broken app with no diagnostic, silently accumulating a queue that will never drain.

Suggested direction — Give misconfiguration a distinct error (not status 0) so it isn’t queued as offline; gate the UI on isApiConfigured()/isSupabaseConfigured with a visible hard-fail in dev/preview.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions