Repository navigation
fix(app): honor OMI_AUTH_CALLBACK_SCHEME build-time define for preview builds - #22052
ocakciomursel-pixel wants to merge 3 commits into
Conversation
|
Verdict: the production change is correct, minimal, and implements exactly the fix suggested in #19244; one wiring gap to address before merge.
The gap: the dart-define only changes the redirect URI the app requests; the scheme iOS actually registers still comes from Security: low — the define is a build-time constant selecting among custom schemes; no new runtime input reaches the redirect URI. Blast radius: only builds that opt into the define; released builds unchanged. USER IMPACT: none for App Store or beta builds — nothing changes unless a build explicitly sets OMI_AUTH_CALLBACK_SCHEME. Still wanted as a reviewer: a note or assertion tying Auth redirect flow change — leaving for human maintainer review of the native-scheme pairing before merge. Automated review on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…BACK_SCHEME in setup.sh - Trim definedScheme in authCallbackSchemeForProfile so whitespace-only defines fall back to profile default - Add unit test coverage for whitespace-only and padded defines in env_test.dart - Wire OMI_AUTH_CALLBACK_SCHEME in setup.sh: set AUTH_CALLBACK_SCHEME in ios/Flutter/Custom.xcconfig and forward dart-define to flutter run
|
Thanks @Git-on-my-level for the feedback and for catching the native scheme pairing! Updated in commit 84bd890:
|
Git-on-my-level
left a comment
There was a problem hiding this comment.
The Dart-side override is correct and nicely tested, but the build wiring doesn't actually deliver it on iOS — the advertised workflow still fails, so this needs one more pass.
What's good:
- app/lib/env/env.dart —
authCallbackSchemeForProfiletrims the define and falls back toconfiguredProfile.authCallbackSchemeon empty/whitespace, so builds withoutOMI_AUTH_CALLBACK_SCHEMEbehave exactly as before. The doc comment explains the iOS redirect-collision root cause well. - app/test/unit/env_test.dart — solid coverage of the override, fallback (production →
omi, mobileBeta →omi-beta), and whitespace-trim cases. - app/setup.sh
generate_ios_custom_config— writingAUTH_CALLBACK_SCHEMEintoios/Flutter/Custom.xcconfigcorrectly moves the nativeCFBundleURLSchemesentry ($(AUTH_CALLBACK_SCHEME)inRunner/Info*.plist).
Blocking:
run_build_ios(app/setup.sh ~518–574) never passes--dart-define=OMI_AUTH_CALLBACK_SCHEMEtoflutter run— the injection loop was added only torun_build_android(~351–362). SoOMI_AUTH_CALLBACK_SCHEME=omi-preview bash setup.sh ios(the usage line this PR adds) registersomi-previewnatively while Dart still redirects toomi://auth/callback: iOS keeps handing the callback to the App Store app, i.e. the exact #19244 failure. Please mirror thehas_callback_defineloop inrun_build_ios(or hoist both into a shared helper).- Android:
run_build_androidinjects the define, but the scheme is hardcoded per flavor (android/app/src/dev/AndroidManifest.xml→omi-dev,src/prod→omi-beta) with no manifest placeholder. With the env var set on Android, the app requests a redirect no intent-filter matches, breaking sign-in there. Either wire a manifest placeholder through the Gradle config or don't inject on Android and document the define as iOS-only.
Security: the override is opt-in and developer-facing; custom-scheme redirects are inherently interceptable on shared devices, but that's pre-existing and the backend already accepts arbitrary schemes. Blast radius: released/default builds are unchanged (define absent → identical behavior); only opt-in preview builds are affected.
USER IMPACT: none for released builds — this only changes optional developer/preview build configuration.
Still wanted as a reviewer: the iOS define injection, the Android story (placeholder or iOS-only scoping), and a CI run on this head (no checks have reported yet).
Leaving for human maintainer review — this alters the OAuth callback-redirect configuration surface, and the build-flow direction needs sign-off from someone owning mobile release tooling.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Thanks @Git-on-my-level for the thorough review and catching both build-wiring gaps! Updated in commit
|
Dismissed as stale: both blocking concerns from this review are resolved on head 4f3ca5a — run_build_ios now injects --dart-define=OMI_AUTH_CALLBACK_SCHEME (app/setup.sh ~546-557), and the Android injection was removed with the define documented as iOS-only (~352-354).
|
Since my last review: addressed (iOS now injects the define in Both blocking issues from my earlier review are fixed; this now delivers the advertised
Security: the define is opt-in developer/preview build configuration; released and default builds are unchanged in behavior. Custom-scheme redirect interceptability on shared devices is pre-existing and untouched here. USER IMPACT: none for released builds — this only improves optional developer/preview iOS builds, which can now complete sign-in next to the App Store app. Still wanted as a reviewer: a CI run on this head (no checks have reported), and maintainer sign-off on this auth-adjacent build wiring before merge — leaving for human maintainer review. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
@Git-on-my-level need human response Thanks for confirming that both prior build-wiring blockers are fixed. Current head 4f3ca5a remains unchanged. Mobile App Checks and Repo Checks are awaiting maintainer workflow approval. Please approve the current-head runs and provide the mobile release/auth-tooling decision on the opt-in iOS callback-scheme override. The Android injection remains removed; real-device OAuth coexistence has not been independently demonstrated here. |
What changed and why
Closes #19244.
OMI_AUTH_CALLBACK_SCHEMEbuild-time define (app/lib/env/env.dart): Production-profile preview builds signed with their own bundle ID shareAppEnvironmentProfile.production.authCallbackScheme(omi) with the App Store Omi app. When both are installed on the same iOS device, iOS routes theomi://auth/callbackOAuth redirect to the App Store app instead of the preview build.Env.authCallbackSchemenow readsString.fromEnvironment('OMI_AUTH_CALLBACK_SCHEME')when non-empty and falls back toprofile.authCallbackScheme, exposed viaEnv.authCallbackSchemeForProfilefor unit testing.Product invariants affected
none
How it was verified
Added unit test coverage in
app/test/unit/env_test.dartexercisingEnv.authCallbackSchemeForProfilewith and without a defined scheme override acrossproductionandmobileBetaprofiles.Tests
app/test/unit/env_test.dartUI evidence
UI-Evidence: none -- build-time environment configuration and unit test only.
Failure class (fixes)
Failure-Class: none