Skip to content

fix(app): align community mobile Firebase config with the remote dev backend #9404

Closed

Description

@Git-on-my-level

Summary

Community developers are still blocked from contributing to the mobile app: the supported iOS/Android setup path signs users into based-hardware-dev, then sends those tokens to https://api.omiapi.com/, whose live backend verifies Firebase identities for based-hardware. The resulting API calls fail with 401 after an apparently successful sign-in.

This follows up on #5939, which was closed without an implementation. Community users have continued to ask for a supported mobile development path, including the latest follow-up on that issue.

Verified current state

  • app/setup.sh and app/setup/scripts/setup.ps1 copy prebuilt Firebase configs for based-hardware-dev into iOS and Android dev builds.
  • The prebuilt Android, iOS, and Dart Firebase options all declare based-hardware-dev.
  • Codemagic has eight active FlutterFire dev-config generation steps that also use --project=based-hardware-dev, so CI rebuilds recreate the mismatch.
  • The deployed dev Cloud Run backend and GKE listener use a based-hardware Firebase service account; the backend initializes Firebase Admin with that credential and verifies bearer ID tokens.

Proposed scope

  1. Regenerate the prebuilt Firebase configuration as a complete set against based-hardware for the existing dev app registrations. Do not text-replace project IDs: API keys, app IDs, client IDs, storage buckets, and auth domains are project-specific.
  2. Update each Codemagic dev-config FlutterFire invocation to use based-hardware and a CI service account with access to that project. Verify the configured Android and iOS app registrations exist there.
  3. Repoint or remove the currently-unused service-account generator functions in app/setup.sh and app/setup/scripts/setup.ps1 so they cannot reintroduce the mismatch.
  4. Update developer documentation that currently normalizes the 401 or tells developers that based-hardware-dev is the expected remote-dev Firebase project.
  5. Add a regression check asserting that any mobile profile targeting api.omiapi.com uses Firebase project based-hardware.

Keep separate

Do not globally replace every based-hardware-dev reference. It remains the dev deployment/registry/Secret Manager project, and isolated local-backend work needs a distinct local Firebase/emulator profile. The desired profiles are:

Profile API Firebase identity
Community remote staging https://api.omiapi.com/ based-hardware
Isolated local development local backend/emulator emulator or based-hardware-dev

The native macOS desktop app is already correctly configured for based-hardware; legacy Flutter macOS CI configuration should be updated or retired with the mobile config work.

Acceptance criteria

  • A clean iOS and Android community setup can sign in and make an authenticated request to api.omiapi.com without a 401.
  • Codemagic-built dev artifacts use the same Firebase project as the remote backend.
  • The local-development path remains documented and usable without silently pointing at production data.

Related to #5939.

Activity

  1. added
    bug
    on Jul 10, 2026
  2. aryanorastar commented on Aug 5, 2026

    @aryanorastar
    Collaborator

    Opened phase-1 PR: #11135

    Landed without FlutterFire/GCP admin access:

    • Fail-closed setup.sh / setup.ps1 when api.omiapi.com + prebuilt ≠ based-hardware (escape: OMI_ALLOW_FIREBASE_MISMATCH=1 for local/emulator)
    • Removed dead based-hardware-dev FlutterFire generators that would reintroduce the mismatch
    • Docs: profile table + 401 troubleshooting in AppSetup.mdx
    • Shrink-only CI check + allowlist for the known prebuilt debt

    Still needs a maintainer to regenerate app/setup/prebuilt/* via FlutterFire against based-hardware (not text-replace — #5945), empty the allowlist, and retarget Codemagic SA/project. Until then default community setup.sh exits 1 instead of silently producing 401s.

  3. aryanorastar commented on Aug 15, 2026

    @aryanorastar
    Collaborator

    Update: closed #11135 as superseded by #11273’s explicit local vs beta Firebase/API profiles.

    Default community setup on main no longer points local builds at api.omiapi.com + based-hardware-dev. If #9404 can still reproduce on the beta/remote path (or via leftover setup/prebuilt/google-services.json still labeled based-hardware-dev), please say so — that would be a small follow-up under the new profile model, not a reopen of #11135.

  4. Git-on-my-level commented on Sep 8, 2026

    @Git-on-my-level
    MemberAuthor

    Closing as resolved on current main. The pairing this issue reported (sign in to based-hardware-dev, then call api.omiapi.com) no longer exists: app/setup.sh and setup.ps1 copy only the -Local Firebase configs (project demo-omi-local) for the supported local profile, and the only profile that targets api.omiapi.com is mobile_beta, generated with flutterfire --project=based-hardware. #11273 landed the explicit local-vs-beta profile model that superseded #11135. Two cosmetic leftovers, not worth holding this open: app/setup/prebuilt/{google-services.json,GoogleService-Info.plist,firebase_options.dart} still declare based-hardware-dev and are unreferenced, and check-mobile-production-routing.py pins api.omi.me rather than also guarding api.omiapi.com.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions