Repository navigation
fix(desktop): disable beta→dev backend routing — creating ghost Firebase accounts - #7040
Conversation
…irebase accounts PR #7014 routed prod-bundle beta-channel users to api.omiapi.com + the dev desktop-backend, with the assumption that both would still read prod Firestore. In practice, signing in via the dev path lands users in fresh empty Firebase accounts (e.g. caLCFj7… instead of viUv7Gtdo… for [email protected]) — so they sign in successfully but see zero data. Surgical fix: make `shouldUseDevelopmentBackends` always return false so prod-beta clients keep using prod backends. Routing scaffolding is left in place for when the auth-side issue is fixed. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Greptile SummaryThis PR hotfixes a critical production regression where beta-channel macOS users were being signed into freshly-minted Firebase accounts (no email, no providers) instead of their existing accounts, caused by PR #7014 routing Confidence Score: 4/5Safe to merge — the fix is minimal, targeted, and correctly stops ghost-account creation for beta users. Only P2 findings (real username/UID in a source comment). The core logic change is a one-liner with matching test updates and a clear reversion path once the underlying auth issue is diagnosed. No files require special attention beyond the minor comment wording in DesktopBackendEnvironment.swift. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Desktop app launches] --> B[applyReleaseChannelDefaults]
B --> C{shouldUseDevelopmentBackends}
C -- "always false (this PR)" --> D[No env vars set by this path]
C -- "previously: beta/staging → true" --> E[setenv OMI_PYTHON_API_URL = dev\nsetenv OMI_DESKTOP_API_URL = dev]
D --> F[pythonBaseURL / rustBackendURL]
E --> F
F --> G{OMI_PYTHON_API_URL set?}
G -- yes --> H[Use env-var URL]
G -- no --> I[Use productionPythonAPIURL\nhttps://api.omi.me/]
F --> J{useDevelopmentBackends?}
J -- "false (this PR)" --> K{OMI_DESKTOP_API_URL set?}
J -- "true (old beta path)" --> L[developmentRustBackendURL\ndt5lrfkkoa-uc.a.run.app]
K -- yes --> M[Use env-var Rust URL]
K -- no --> N[Return empty string]
Reviews (1): Last reviewed commit: "fix(desktop): disable beta→dev backend r..." | Re-trigger Greptile |
| // Beta-to-dev routing disabled: signed-in users were landing in fresh empty | ||
| // Firebase accounts (e.g. caLCFj7… instead of viUv7Gtdo… for kodjima33), | ||
| // because the dev backend's auth path mints custom tokens for new UIDs | ||
| // instead of linking to the existing prod user. Keep beta on prod backends | ||
| // until the auth flow is fixed. | ||
| return false |
There was a problem hiding this comment.
Real user identifier in source comment
The comment embeds kodjima33 (a real email/username) and partial Firebase UIDs (caLCFj7…, viUv7Gtdo…) in tracked source code. Even truncated, these UIDs tie a real person's identity to a specific Firebase account record. Comments in VCS history are public and permanent — prefer pseudonyms or ticket references when documenting auth bugs.
…ase accounts (BasedHardware#7040) ## Problem Production-bundle macOS users on the `beta` update channel are landing in **fresh empty Firebase accounts** after sign-in. Concrete repro: signing in as `[email protected]` on build `0.11.365` creates new Firebase user `caLCFj7IisV85UX9XrrV1aVf3pk1` (no email, no providers, created today) instead of returning the existing `viUv7GtdoHXbK1UBCDlPuTDuPgJ2` that owns all of kodjima33's data. Reported as widespread across beta users. Both UIDs are in the same `based-hardware` Firebase project (`aud: based-hardware`, `iss: https://securetoken.google.com/based-hardware`), so it's not a project mismatch — the dev auth flow is minting tokens for new UIDs instead of linking to existing ones. ## Cause PR BasedHardware#7014 (`60046c19f`) routed `com.omi.computer-macos` clients on the `beta` channel to: - Python: `https://api.omiapi.com/` - Rust: `https://desktop-backend-dt5lrfkkoa-uc.a.run.app/` The `OMI_AUTH_URL` is unchanged (still prod `omi-desktop-auth`), but downstream calls through the dev Python backend during sign-in result in a different uid being returned to the client. The empty user record on the new uid (no email, no providers) indicates the path goes through `signInWithCustomToken` for a freshly-generated uid rather than `signInWithIdp` linking by email. ## Fix Surgical: `shouldUseDevelopmentBackends` now always returns `false`, so prod-beta clients keep talking to prod backends. The routing scaffolding (`DesktopBackendEnvironment`, env-var override paths, `applyReleaseChannelDefaults`) is left in place for when the auth-side issue is properly diagnosed and fixed — at that point this can be reverted. A full `git revert` of BasedHardware#7014 conflicts with newer changes to `TranscriptionService.swift` and others; this 1-line approach gets the same effect with no merge surgery. ## Verification - [ ] Codemagic build succeeds - [ ] Mac mini smoke test: sign in as kodjima33 on the new build, confirm uid = `viUv7GtdoHXbK1UBCDlPuTDuPgJ2` and data loads - [ ] Confirm `APIClient.baseURL` resolves to `https://api.omi.me/` for prod-beta - [ ] Confirm `rustBackendURL` resolves to the prod `desktop-backend-hhibjajaja-uc.a.run.app` (or the env-var override) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Problem
Production-bundle macOS users on the
betaupdate channel are landing in fresh empty Firebase accounts after sign-in. Concrete repro: signing in as[email protected]on build0.11.365creates new Firebase usercaLCFj7IisV85UX9XrrV1aVf3pk1(no email, no providers, created today) instead of returning the existingviUv7GtdoHXbK1UBCDlPuTDuPgJ2that owns all of kodjima33's data. Reported as widespread across beta users.Both UIDs are in the same
based-hardwareFirebase project (aud: based-hardware,iss: https://securetoken.google.com/based-hardware), so it's not a project mismatch — the dev auth flow is minting tokens for new UIDs instead of linking to existing ones.Cause
PR #7014 (
60046c19f) routedcom.omi.computer-macosclients on thebetachannel to:https://api.omiapi.com/https://desktop-backend-dt5lrfkkoa-uc.a.run.app/The
OMI_AUTH_URLis unchanged (still prodomi-desktop-auth), but downstream calls through the dev Python backend during sign-in result in a different uid being returned to the client. The empty user record on the new uid (no email, no providers) indicates the path goes throughsignInWithCustomTokenfor a freshly-generated uid rather thansignInWithIdplinking by email.Fix
Surgical:
shouldUseDevelopmentBackendsnow always returnsfalse, so prod-beta clients keep talking to prod backends. The routing scaffolding (DesktopBackendEnvironment, env-var override paths,applyReleaseChannelDefaults) is left in place for when the auth-side issue is properly diagnosed and fixed — at that point this can be reverted.A full
git revertof #7014 conflicts with newer changes toTranscriptionService.swiftand others; this 1-line approach gets the same effect with no merge surgery.Verification
viUv7GtdoHXbK1UBCDlPuTDuPgJ2and data loadsAPIClient.baseURLresolves tohttps://api.omi.me/for prod-betarustBackendURLresolves to the proddesktop-backend-hhibjajaja-uc.a.run.app(or the env-var override)🤖 Generated with Claude Code