Skip to content

Revert "feat(desktop): route beta channel to dev backend"#7230

Merged
kodjima33 merged 1 commit into
mainfrom
worktree-revert-beta-dev-routing
May 11, 2026
Merged

Revert "feat(desktop): route beta channel to dev backend"#7230
kodjima33 merged 1 commit into
mainfrom
worktree-revert-beta-dev-routing

Conversation

@kodjima33
Copy link
Copy Markdown
Collaborator

Reverts #7224. The change was merged before being validated locally; we want to test the dev-backend routing on a named local bundle first (using the OMI_FORCE_DEV_BACKENDS override I added in that PR — except the env-var didn't actually reach the launched .app because run.sh loads URLs via a baked Contents/Resources/.env, not shell env). Reverting on main, validating locally, then redoing.

The diagnostic PR #7227 stays — that's an unrelated workflow hardening that's useful regardless.

🤖 Generated with Claude Code

@kodjima33 kodjima33 merged commit d44b4a3 into main May 11, 2026
2 checks passed
@kodjima33 kodjima33 deleted the worktree-revert-beta-dev-routing branch May 11, 2026 00:21
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 11, 2026

Greptile Summary

This revert disables the beta-channel → development-backend routing introduced in #7224, after discovering that the dev backend mints fresh Firebase UIDs for existing prod users (causing data isolation issues). The shouldUseDevelopmentBackends function now unconditionally returns false, keeping all builds on production backends until the auth flow is fixed and the change can be validated locally first.

  • DesktopBackendEnvironment.swift: shouldUseDevelopmentBackends hardcoded to false; forceOverride/OMI_FORCE_DEV_BACKENDS support and isAffirmative helper removed. normalizedChannel is now dead code (left behind, not removed).
  • APIClientRoutingTests.swift: Previous beta-routing and force-override tests replaced with a single testDevelopmentBackendRoutingDisabled test that asserts false across all input combinations.

Confidence Score: 4/5

Safe to merge — all builds will continue routing to production backends, and the revert correctly undoes the problematic beta-channel routing.

The change is a clean, well-motivated revert. The only rough edges are two leftover artefacts: the normalizedChannel private helper is now unreferenced dead code, and the bundleIdentifier/updateChannel parameters are accepted but ignored. Neither affects runtime behavior, but they leave the codebase slightly messier than it needs to be for what is described as a temporary state.

desktop/Desktop/Sources/DesktopBackendEnvironment.swift — dead normalizedChannel function and unused parameters worth cleaning up before the feature is re-landed.

Important Files Changed

Filename Overview
desktop/Desktop/Sources/DesktopBackendEnvironment.swift Reverts beta-to-dev backend routing by hardcoding shouldUseDevelopmentBackends to false; removes forceOverride/isAffirmative helpers. Leaves normalizedChannel as dead code and keeps unused bundleIdentifier/updateChannel parameters.
desktop/Desktop/Tests/APIClientRoutingTests.swift Collapses the four beta-routing tests into a single testDevelopmentBackendRoutingDisabled method that asserts false for all input combinations; all other routing coverage is untouched.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[App launch] --> B{shouldUseDevelopmentBackends}
    B -- "always false (post-revert)" --> C[Use production backends]
    C --> D[api.omi.me Python API]
    C --> E[desktop-backend prod Rust API]

    B -. "intended future path\n(re-land after auth fix)" .-> F{bundleId == prod\nAND channel == beta?}
    F -- Yes --> G[Use development backends]
    F -- No --> C
    G --> H[api.omiapi.com Python API]
    G --> I[desktop-backend dev Rust API]
Loading

Comments Outside Diff (1)

  1. desktop/Desktop/Sources/DesktopBackendEnvironment.swift, line 87-92 (link)

    P2 The normalizedChannel private helper is now dead code — it was only called inside shouldUseDevelopmentBackends, which now returns false unconditionally without referencing it. Swift will emit a warning for unreferenced private functions in strict builds, and the dead symbol creates confusion for anyone re-landing the feature. It should be removed alongside the routing logic it supported.

Reviews (1): Last reviewed commit: "Revert "feat(desktop): route beta channe..." | Re-trigger Greptile

Comment on lines 15 to 18
static func shouldUseDevelopmentBackends(
bundleIdentifier: String,
updateChannel: String,
forceOverride: String? = nil
updateChannel: String
) -> Bool {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Both bundleIdentifier and updateChannel are now unused parameters in shouldUseDevelopmentBackends. The call-site in the computed shouldUseDevelopmentBackends var still passes them, but the function body ignores them entirely. Swift may warn about unused variables here, and it creates a misleading API surface — callers could reasonably assume the values affect the result. Dropping them from the signature (and the call-site) makes the temporary return false state self-documenting.

Suggested change
static func shouldUseDevelopmentBackends(
bundleIdentifier: String,
updateChannel: String,
forceOverride: String? = nil
updateChannel: String
) -> Bool {
static func shouldUseDevelopmentBackends(
bundleIdentifier: String = "",
updateChannel: String = ""
) -> Bool {

kodjima33 added a commit that referenced this pull request May 11, 2026
Reapplies #7224 after the #7230 revert. Verified locally this time:

- Named bundle (`com.omi.omi-beta-dev-test`) launched with shell-bundled
dev URLs (`OMI_PYTHON_API_URL=https://api.omiapi.com/`,
`OMI_DESKTOP_API_URL=https://desktop-backend-dt5lrfkkoa-uc.a.run.app/`).
- Signed in with `kodjima33@gmail.com` — landed on **prod UID
`viUv7GtdoHXbK1UBCDlPuTDuPgJ2`** (not a ghost dev UID).
- Existing chat history and tasks loaded.
- New requests go through dev backend: `POST
https://api.omiapi.com/v2/desktop/messages`, `/v3/memories`,
`/v1/action-items` — all succeeding, AgentSync pushing rows.
- Confirms dev backend's `SERVICE_ACCOUNT_JSON`, `FIREBASE_API_KEY`,
`FIREBASE_PROJECT_ID` are all on prod Firebase (`based-hardware`), so
dev-issued custom tokens resolve to the same prod UID.

This time the change ships through the existing #7227 diagnostic patch
(already on main), so if Codemagic's universal-bundle step trips again
we'll get a real error instead of a 0.6s opaque failure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pull Bot pushed a commit to codingwatching/omi that referenced this pull request May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant