Repository navigation
fix(app): fail-closed community Firebase/API alignment (#9404) - #11135
aryanorastar wants to merge 5 commits into
Conversation
…#9404) Encode the remote-staging contract (api.omiapi.com ↔ based-hardware), remove dead based-hardware-dev FlutterFire generators, and ratchet the known prebuilt mismatch until maintainers regenerate configs via FlutterFire. Failure-Class: none Co-authored-by: Cursor <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for digging into the Firebase/API mismatch and for making the PR intentionally fail closed rather than silently shipping another 401 path. The direction is useful, but I don't think this head is safe to merge yet.
I'm not repeating the full AI-review list; the two merge-blocking issues I verified are:
-
The documented local-backend escape does not actually switch setup to a local backend.
app/setup.shstill assignsAPI_BASE_URL=https://api.omiapi.com/unconditionally before writing.dev.env, so the docs'API_BASE_URL=http://127.0.0.1:8000/ ... bash setup.sh ioscommand is overwritten. The PowerShell path has the same issue:Validate-FirebaseApiAlignmentandSetupAppEnvboth hardcodehttps://api.omiapi.com/. WithOMI_ALLOW_FIREBASE_MISMATCH=1, users can bypass the guard while the app remains pointed at remote staging withbased-hardware-devtokens, which recreates the 401 failure mode this PR is trying to prevent. -
The runtime setup guards only parse
setup/prebuilt/google-services.json, while the app also consumes the copied Dart and plist Firebase configs. The new CI checker compares all three prebuilt artifacts, which is good, butsetup.sh/setup.ps1can still pass locally ifgoogle-services.jsonis corrected andfirebase_options.dartorGoogleService-Info.plistis stale/mismatched. The fail-closed behavior should use the same cross-artifact project-id check at setup time, or call a shared validator, before allowing remote staging.
Please make the setup scripts and docs agree on an achievable local-backend flow, and make the runtime guard validate the same Firebase artifacts the app will actually use. After that, this looks like a reasonable fail-closed phase-1 approach pending maintainer follow-up to regenerate the committed Firebase configs.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
…edHardware#9404) Address review: setup.sh/ps1 now keep caller API_BASE_URL overrides, validate json+dart+plist project ids together, and document a workable local-backend escape. Tighten the CI allowlist to based-hardware-dev only and require a real validator invocation. Co-authored-by: Cursor <[email protected]>
Addressed review @5ffa5d5fThanks @Git-on-my-level — both merge-blocking items fixed:
Also covered the related cubic tightenings (invocation check, allowlist exactly |
|
@Git-on-my-level need human response — re-review request. Both merge-blocking items are fixed on head |
|
Thanks for the update. I re-checked the current head and the two blockers from my previous review look resolved:
I also verified the new checker/fixture tests locally: This looks like a reasonable phase-1 guardrail for #9404. I’m leaving it for human maintainer sign-off because it changes setup/CI guard behavior and still requires the maintainer-owned Firebase/FlutterFire follow-up before the default community remote-staging setup becomes usable again. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Current head 5ffa5d5 resolves the two stated blockers: API_BASE_URL override is honored and runtime setup now cross-checks all copied Firebase artifacts.
|
Author-side clear for merge as phase-1 fail-closed guardrail. @Git-on-my-level dismissed the CR after verifying both blockers on Still needs write-access APPROVE to clear the branch protection gate. @kodjima33 — if you’re comfortable merging a setup/CI fail-closed change that intentionally breaks default community remote-staging setup until FlutterFire regen, please APPROVE/merge. FlutterFire prebuilt regen + Codemagic retarget remain maintainer follow-up (called out in the PR body); this PR does not claim those. |
|
@kodjima33 final approval reminder: PR #11135 is fully CI-green at 5ffa5d5, and @Git-on-my-level dismissed the stale CR after verifying the local API_BASE_URL escape plus Firebase JSON/Dart/plist cross-check (9/9 fixture tests). The remaining gate is write-access approval; FlutterFire regeneration, app registrations, and Codemagic IAM are explicitly maintainer follow-up outside this phase-1 guardrail PR. |
|
@kodjima33 need human response — write-access APPROVE / merge for #11135. Author-clear on tip
Please APPROVE/merge when comfortable, or say if you want the FlutterFire follow-up landed first. |
…lake Co-authored-by: Cursor <[email protected]>
|
Desktop Swift red on tip
Pushed empty tip |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for continuing to tighten this fail-closed Firebase/API alignment path. I re-reviewed the current head and the overall direction still looks useful for #9404, but I found one Windows setup-path blocker that needs fixing before merge.
Blocking issue:
app/setup/scripts/setup.ps1:Get-FirebaseProjectIdFromPrebuiltassigns the unique DartprojectIdpipeline result to$idsand then uses$ids.Count/$ids[0]. UnderSet-StrictMode -Version Latest, when the Dart file contains one unique project id (the normal case),$idsis a scalar string; accessing.Countfails before validation can complete. I reproduced this in PowerShell 7.4 in Docker against this head'sapp/setup/prebuilt/firebase_options.dart. The Bash path works, but the PowerShell setup guard cannot parse the normal Dart config shape. Please force the pipeline result to an array, e.g.$ids = @([regex]::Matches(...) | ... | Sort-Object -Unique), and add a focused PowerShell/parser fixture so CI catches this path.
File-by-file notes:
.github/checks-manifest.yaml: registering both the static checker and mutation-test fixture commands is the right shape for a diff-scoped guard on setup/Firebase alignment..github/scripts/check-mobile-community-firebase-alignment.py: the checker sensibly compares the copied JSON, Dart, and plist configs, requires setup-script invocation, and treats thebased-hardware-devexception as shrink-only debt rather than an open-ended allowlist..github/scripts/mobile_community_firebase_alignment_allowlist.json: the current allowlist is narrow (based-hardware-devonly) and clearly documents that it should shrink to empty after real FlutterFire regeneration..github/scripts/test_check_mobile_community_firebase_alignment.py: the Python fixtures cover the important CI contract edges, but they do not execute the PowerShell parser semantics that broke here.app/setup.sh: the Bash runtime guard now honorsAPI_BASE_URL, checks all three prebuilt artifacts, fails closed for remote staging +based-hardware-dev, and allows the documented local-backend override; I exercised those paths locally.app/setup/scripts/setup.ps1: conceptually mirrors the Bash guard, but the Dart parser bug above makes the normal PowerShell path fail under strict mode.docs/doc/developer/AppSetup.mdx: the updated docs accurately explain why remote staging requiresbased-hardwareand document the local-backend escape while the prebuilt configs are still maintainer debt.docs/rayban-meta-founder-acceptance.md: the Ray-Ban acceptance note is aligned with the new Firebase/API reality and avoids implyingbased-hardware-devtokens can authenticate toapi.omiapi.com.
Validation I ran:
python3 .github/scripts/check-mobile-community-firebase-alignment.py -> OK
python3 .github/scripts/test_check_mobile_community_firebase_alignment.py -> 9 tests OK
bash -n app/setup.sh -> OK
Bash guard default remote API + current based-hardware-dev prebuilt -> exits 1 as intended
Bash guard with API_BASE_URL=http://127.0.0.1:8000/ -> passes
PowerShell 7.4 Docker parser probe on firebase_options.dart -> fails on $ids.Count under strict mode
Once the PowerShell parser is fixed and covered, this looks like a good phase-1 guardrail. I’m leaving it for human maintainer review because it changes workflow/setup guard behavior and still depends on the maintainer-owned Firebase/FlutterFire regeneration follow-up before default remote-staging setup becomes usable again.
by AI on behalf of David — PowerShell setup behavior and Firebase/FlutterFire follow-up need maintainer sign-off before merge.
…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 <[email protected]>
Addressed review @0d0a3159a842@Git-on-my-level PowerShell StrictMode blocker fixed, and the PR is rebased onto main’s #11273 local/emulator Firebase default. David blocker
Conflicts / #11273 reshapeMain no longer defaults community setup to
Local verificationReady for re-review / dismiss CR. Write-access APPROVE still needed after you’re happy; FlutterFire follow-up for any remaining legacy non-local prebuilts stays maintainer-side. |
Resolved on 0d0a315: app/setup/scripts/setup.ps1 now forces the Dart projectId Match pipeline into @(...), and the PR adds focused parser fixture coverage.
|
Thanks for the follow-up. I re-reviewed head File notes:
Validation I ran: I dismissed my stale changes-request review for the now-fixed PS1 parser issue and removed by AI on behalf of David — leaving for human maintainer review because Firebase setup/workflow behavior and the maintainer-owned FlutterFire regeneration path need sign-off before merge. |
|
@kodjima33 need human response — write-access APPROVE / merge for #11135 / #9404. Author-clear on
Please APPROVE/merge when comfortable, or say if you want the FlutterFire follow-up landed first. |
|
@kodjima33 maintainer approval ping: current head is MERGEABLE with the validation suite green. The repository-only Firebase/API fail-closed phase is complete; remaining prebuilt FlutterFire regeneration is maintainer ops. Please approve or state the required hold. |
|
@kodjima33 write-access APPROVE / merge ping: still MERGEABLE, author-side clear. |
|
@Git-on-my-level @kodjima33 current |
|
Closing as superseded by #11273 (merged). Current Residual note (not this PR): |
|
Hey @aryanorastar 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Community mobile setup signed into
based-hardware-devwhilehttps://api.omiapi.com/verifies Firebase tokens forbased-hardware, causing 401 after an apparently successful sign-in (#9404 / #5939).Phase-1 (no FlutterFire/GCP admin access): fail-closed setup alignment, remove dead
based-hardware-devFlutterFire generators, document the two profiles, and add a shrink-only CI allowlist until prebuilt configs are regenerated.What this does not claim
app/setup/prebuilt/*againstbased-hardware(requires maintainer FlutterFire + app registrations; text-replace was rejected in fix: update Firebase project from based-hardware-dev to based-hardware in prebuilt configs #5945).--project=/FIREBASE_SERVICE_ACCOUNT_DEV_KEYIAM (needs secret access).bash setup.shnow exits 1 until prebuilt is fixed.API_BASE_URL=http://127.0.0.1:8000/ bash setup.sh ios(override is honored; setup validates all three prebuilt Firebase artifacts agree).Maintainer follow-up (unblocks acceptance)
com.friend.ios.dev+com.friend-app-with-wearable.ios12.developmentexist under Firebasebased-hardware.app/setup/prebuilt/{firebase_options.dart,google-services.json,GoogleService-Info.plist}via FlutterFire..github/scripts/mobile_community_firebase_alignment_allowlist.json.based-hardwareand update SA IAM.Test plan
python3 .github/scripts/check-mobile-community-firebase-alignment.py→ OKpython3 .github/scripts/test_check_mobile_community_firebase_alignment.py→ 9/9validate_firebase_api_alignmentexits 1 on current prebuilt + remote API; succeeds withAPI_BASE_URL=http://127.0.0.1:8000/api.omiapi.comwithout 401 after FlutterFire regenFailure Class
Failure-Class: none