fix: make mobile emulator and beta Firebase profiles explicit - #11273
Conversation
Failure-Class: none
There was a problem hiding this comment.
2 issues found across 28 files
Confidence score: 2/5
- In
app/setup.sh, the iOS beta Google Sign-In flow still uses the production reverse-client URL scheme, so OAuth callbacks can fail for beta builds using the beta Firebase bundle ID and users may be unable to sign in — switch to the beta-generated reverse-client scheme for beta configuration. - In
app/ios/Flutter/devRelease.xcconfig,INFOPLIST_FILE=Runner/Info-Dev.plistmay be superseded by target-levelRelease-devsettings that keepRunner/Info.plist, which can silently apply the wrong plist at build time and break environment-specific behavior — align/remove the target-level override in the Runner build configuration so the intended plist is used.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/setup.sh">
<violation number="1" location="app/setup.sh:216">
P1: iOS beta Google sign-in still exposes the hard-coded prod reverse-client URL scheme, not the scheme generated for the beta Firebase bundle ID, so OAuth cannot return to a beta app with its own registered Firebase configuration. Let the generated `Custom.xcconfig` value override/remove the later `GOOGLE_REVERSE_CLIENT_ID` assignments in prod flavor configs.</violation>
</file>
<file name="app/ios/Flutter/devRelease.xcconfig">
<violation number="1" location="app/ios/Flutter/devRelease.xcconfig:10">
P2: The added INFOPLIST_FILE=Runner/Info-Dev.plist may be overridden by the Runner target's Release-dev XCBuildConfiguration, which hardcodes INFOPLIST_FILE = Runner/Info.plist at target level (pbxproj), and target build settings win over .xcconfig. If that override isn't removed in this PR, the dev release build silently keeps using the wrong plist — exactly the opaque mismatch this change is meant to eliminate. Confirm the pbxproj override is updated (e.g. to $(INFOPLIST_FILE) or removed) for the devRelease config, or this line has no effect.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| fi | ||
| setup_firebase \ | ||
| && setup_firebase_with_service_account_ios \ | ||
| && generate_ios_custom_config Prod omi-beta \ |
There was a problem hiding this comment.
P1: iOS beta Google sign-in still exposes the hard-coded prod reverse-client URL scheme, not the scheme generated for the beta Firebase bundle ID, so OAuth cannot return to a beta app with its own registered Firebase configuration. Let the generated Custom.xcconfig value override/remove the later GOOGLE_REVERSE_CLIENT_ID assignments in prod flavor configs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/setup.sh, line 216:
<comment>iOS beta Google sign-in still exposes the hard-coded prod reverse-client URL scheme, not the scheme generated for the beta Firebase bundle ID, so OAuth cannot return to a beta app with its own registered Firebase configuration. Let the generated `Custom.xcconfig` value override/remove the later `GOOGLE_REVERSE_CLIENT_ID` assignments in prod flavor configs.</comment>
<file context>
@@ -155,36 +169,83 @@ function setup_keystore_android() {
+ fi
+ setup_firebase \
+ && setup_firebase_with_service_account_ios \
+ && generate_ios_custom_config Prod omi-beta \
+ && setup_app_env mobile_beta \
+ && run_build_ios prod --dart-define=OMI_APP_PROFILE=mobile_beta
</file context>
| BUNDLE_NAME=Omi Dev | ||
| BUNDLE_DISPLAY_NAME=Omi Dev | ||
| AUTH_CALLBACK_SCHEME=omi-dev | ||
| INFOPLIST_FILE=Runner/Info-Dev.plist |
There was a problem hiding this comment.
P2: The added INFOPLIST_FILE=Runner/Info-Dev.plist may be overridden by the Runner target's Release-dev XCBuildConfiguration, which hardcodes INFOPLIST_FILE = Runner/Info.plist at target level (pbxproj), and target build settings win over .xcconfig. If that override isn't removed in this PR, the dev release build silently keeps using the wrong plist — exactly the opaque mismatch this change is meant to eliminate. Confirm the pbxproj override is updated (e.g. to $(INFOPLIST_FILE) or removed) for the devRelease config, or this line has no effect.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/ios/Flutter/devRelease.xcconfig, line 10:
<comment>The added INFOPLIST_FILE=Runner/Info-Dev.plist may be overridden by the Runner target's Release-dev XCBuildConfiguration, which hardcodes INFOPLIST_FILE = Runner/Info.plist at target level (pbxproj), and target build settings win over .xcconfig. If that override isn't removed in this PR, the dev release build silently keeps using the wrong plist — exactly the opaque mismatch this change is meant to eliminate. Confirm the pbxproj override is updated (e.g. to $(INFOPLIST_FILE) or removed) for the devRelease config, or this line has no effect.</comment>
<file context>
@@ -6,3 +6,5 @@
BUNDLE_NAME=Omi Dev
BUNDLE_DISPLAY_NAME=Omi Dev
+AUTH_CALLBACK_SCHEME=omi-dev
+INFOPLIST_FILE=Runner/Info-Dev.plist
</file context>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa9aabdf2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| localDev( | ||
| name: 'local_dev', | ||
| defaultApiBaseUrl: 'http://127.0.0.1:8000/', | ||
| firebaseProjectId: 'demo-omi-local', |
There was a problem hiding this comment.
Update the documented dev Firebase contract
This changes the dev flavor from the documented based-hardware-dev Firebase project to demo-omi-local, but app/AGENTS.md still directs agents to use based-hardware-dev. Following that component guide now generates a project mismatch that validateFirebaseProject rejects during startup, so update the guide and its Firebase config paths as part of this change.
AGENTS.md reference: app/AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
| static const firebaseAuthEmulatorHost = String.fromEnvironment( | ||
| 'OMI_FIREBASE_AUTH_EMULATOR_HOST', | ||
| defaultValue: '127.0.0.1', | ||
| ); |
There was a problem hiding this comment.
Choose an Android-reachable emulator host by default
When a developer launches the now-local-by-default dev flavor through the documented flutter run --flavor dev command or an IDE rather than keeping setup.sh as the launcher, this default connects Firebase Auth to 127.0.0.1 inside the Android emulator, not the host machine. The setup wrapper itself recognizes that Android requires 10.0.2.2, so these ordinary subsequent launches cannot authenticate unless the same define is manually repeated; make the runtime default platform-aware or persist/document the required define.
Useful? React with 👍 / 👎.
| LOCAL_API_BASE_URL="${OMI_LOCAL_API_BASE_URL:-http://${LOCAL_DEV_HOST}:8000/}" | ||
| ANDROID_DEV_HOST="${OMI_ANDROID_DEV_HOST:-${OMI_DEV_HOST:-10.0.2.2}}" | ||
| ANDROID_LOCAL_API_BASE_URL="${OMI_LOCAL_API_BASE_URL:-http://${ANDROID_DEV_HOST}:8000/}" | ||
| BETA_API_BASE_URL="${OMI_BETA_API_BASE_URL:-https://api.omiapi.com/}" |
There was a problem hiding this comment.
Honor or remove the beta API override
If OMI_BETA_API_BASE_URL is set to anything other than the default, both beta setup paths pass that value as OMI_API_BASE_URL, but startup compares it against the fixed mobileBeta.defaultApiBaseUrl and throws a StateError. Thus the newly introduced override can only make the beta build fail; either validate/use the configured beta endpoint consistently or stop exposing this override.
Useful? React with 👍 / 👎.
| --out=lib/firebase_options_prod.dart \ | ||
| --ios-bundle-id=com.friend-app-with-wearable.ios12 \ | ||
| --android-app-id=com.friend.ios.dev \ | ||
| --android-app-id=com.friend.ios \ |
There was a problem hiding this comment.
Pass the Android package name to FlutterFire
The advertised setup.sh android beta path now executes this command, but --android-app-id expects a Firebase app identifier rather than an Android package name, so passing com.friend.ios prevents FlutterFire from resolving or generating the production Android configuration. The repository's established FlutterFire invocations in codemagic.yaml use --android-package-name=com.friend.ios; use that flag here and in the equivalent PowerShell command so Android beta setup can reach the build step.
Useful? React with 👍 / 👎.
| if [[ "$profile" == "mobile_beta" ]]; then | ||
| env_file='.env' | ||
| api_base_url="$BETA_API_BASE_URL" | ||
| fi | ||
| printf 'API_BASE_URL=%s\nUSE_WEB_AUTH=true\nUSE_AUTH_CUSTOM_TOKEN=true\n' "$api_base_url" > "$env_file" |
There was a problem hiding this comment.
Preserve existing production environment values
Both beta setup paths select .env here and then overwrite it with only API_BASE_URL, USE_WEB_AUTH, and USE_AUTH_CUSTOM_TOKEN. On any checkout whose production environment already contains PostHog, Maps, Intercom, Google OAuth, or other ProdEnv values, running the newly documented beta command silently deletes them before code generation, producing a beta app with those services unconfigured; update only the intended keys or merge from the existing file instead. The PowerShell WriteAllText path has the same destructive behavior.
Useful? React with 👍 / 👎.
Disable local Crashlytics mapping uploads and address review findings around iOS beta OAuth, plist generation, setup defaults, and profile-isolated Firebase validation.\n\nFailure-Class: none
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddd8339d80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| enum AppEnvironmentProfile { | ||
| localDev( | ||
| name: 'local_dev', | ||
| defaultApiBaseUrl: 'http://127.0.0.1:8000/', |
There was a problem hiding this comment.
Derive a reachable WebSocket URL for local profiles
When the new default local profile supplies http://127.0.0.1:8000/ (or setup supplies http://10.0.2.2:8000/), Env.agentProxyWsUrl passes it to _agentProxyWsUrlFor, which discards the port via Uri.host and always returns wss://...; agent chat therefore attempts TLS on the default port instead of a reachable local endpoint. Preserve the authority and map HTTP to WS, or pass an explicit local agent-proxy override from setup.
AGENTS.md reference: app/AGENTS.md:L124-L127
Useful? React with 👍 / 👎.
| BUNDLE_DISPLAY_NAME=Omi Dev | ||
| APP_BUNDLE_IDENTIFIER=com.friend-app-with-wearable.ios12.development | ||
| AUTH_CALLBACK_SCHEME=omi-dev | ||
| INFOPLIST_FILE=Runner/Info-Dev.plist |
There was a problem hiding this comment.
Generate the dev plist from the Ray-Ban wrapper
When an existing checkout pulls this change and runs the documented scripts/rayban_dat.sh run or build path without rerunning the full iOS setup, every Ray-Ban configuration now references Runner/Info-Dev.plist, but that file is gitignored and the wrapper never invokes generate_ios_dev_info_plist.sh; Xcode therefore fails before launching or building. Generate the plist in the Ray-Ban wrapper or keep a tracked build input available.
AGENTS.md reference: app/AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
…asedHardware#11273 local setup Merge main's local/emulator Firebase default, force PowerShell Dart projectId Matches into @(...), validate the *-local trio at setup time, and update the CI checker/docs for the post-BasedHardware#11273 profiles. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Separate from #11265, this makes mobile Firebase/API environments explicit:
devdevelopment defaults to the local API/emulator harness and the non-productiondemo-omi-localFirebase project.https://api.omiapi.com/.Usage
For a real iPhone on the local path, set
OMI_DEV_HOSTto the Mac's LAN address when the local API/emulator harness is reachable from the phone. Beta requires the registered production Firebase app/bundle ID and backend acceptance of production Firebase tokens plus theomi-betacallback configuration.Verification
flutter test test/unit/env_test.dart— 15/15 passedNSAllowsLocalNetworking=trueandomi-devomiruby -Iios/test ios/test/rayban_dat_xcode_graph_test.rb— 9 runs, 393 assertions, 0 failuresruby -Iios/test ios/test/rayban_dat_build_wrapper_test.rb— 12 runs, 129 assertions, 0 failuresFailure-Class: none