Repository navigation
feat(app): add debug-only local_prod profile for a local backend with production identity - #11418
Merged
Merged
Conversation
… production identity Pairs production Firebase identity (based-hardware) with a developer-chosen backend endpoint, selected only by an explicit OMI_APP_PROFILE=local_prod dart-define. Release builds reject the profile at startup, so no shipped artifact can select it. local_dev keeps its stricter loopback/private-network rule. Amends INV-DATA-1 to enumerate the exception. Verified: flutter test test/unit/env_test.dart (19 passed); ran the prod-flavor app on-device with OMI_APP_PROFILE=local_prod against a locally served backend.
…up errors The runZonedGuarded handler called FirebaseCrashlytics.instance unconditionally; any error thrown before Firebase.initializeApp completed was replaced by a secondary [core/no-app] exception and the root cause was lost. Print the original error and only forward to Crashlytics once Firebase is initialized. Failure-Class: none Verified: reproduced on device — a startup routing StateError previously surfaced only as [core/no-app]; with the guard the real error and stack print.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
local_prodmobile profile: production Firebase identity (based-hardware) paired with a developer-chosen backend endpoint, selected only by an explicit--dart-define=OMI_APP_PROFILE=local_prod. Release builds reject the profile at startup (kReleaseMode), so no shipped artifact can select it.local_devkeeps its stricter loopback/private-network rule.runZonedGuardedcrash handler inmain.dart: it calledFirebaseCrashlytics.instanceunconditionally, so any error thrown beforeFirebase.initializeApp()completed was replaced by a secondary[core/no-app]exception and the root cause was lost. It now prints the original error and only forwards to Crashlytics once Firebase is initialized.Why
Since #11273 the dev flavor is emulator-first (
demo-omi-local) and there is no sanctioned way to run the prod-flavor app against a locally served backend for development.local_prodfills that gap the same waymobile_betadid for the dev serving plane: an explicit, enumerated, build-time profile instead of an env-file or debug-flag bypass.INV-DATA-1
This PR changes
app/lib/env/env.dartandapp/lib/main.dart(INV-DATA-1 path globs). It preserves every production-family routing authority — production and mobile_beta pins are untouched and their rejection tests still pass. It amends the proposed invariant text to enumeratelocal_prodas a debug-only developer-workflow exception; because release builds reject the profile, no production-family artifact can leave its data plane. This is not the deliberate-migration exception.Failure-Class: none
Verification
cd app && flutter test test/unit/env_test.dart— 20 passed (4 new: profile pairing, debug endpoint acceptance incl. tunnel hosts, release-build rejection, malformed-endpoint rejection).OMI_APP_PROFILE=local_prodandOMI_API_BASE_URLpointing at an ngrok tunnel to a locally served backend; app authenticated with production identity and traffic was observed arriving at the local backend.StateErrorthat previously surfaced only as[core/no-app]; with the guard the real error and stack print to the console.🤖 Generated with Claude Code