Repository navigation
Revert public-client env hardening that broke the mobile build - #8772
Merged
Merged
Conversation
Builds 1.0.542+969/970 shipped broken: the secret-boundary PRs (#8716, #8717, #8733, #8741) renamed every app env var to a PUBLIC_ prefix and moved Envied's source to .client.env, but the Codemagic dashboard still defines the old names. The PUBLIC_* exports resolved empty, create-public-client-env.sh skipped them, and Envied baked null into prod — so Env.apiBaseUrl! force-unwrapped to a crash on launch. The post-build artifact scanner also false-positived on Firebase/SDK constant strings (ERROR_INVALID_CREDENTIAL, PROJECT_TOKEN) inside the compiled BatteryWidget.appex, failing 'flutter build ipa'. Restores codemagic.yaml and app/lib/env to the last-good (1.0.533) state so the prod build works with the existing dashboard vars, and reverts the coupled secret-scanner apparatus (scanner scripts, client_env_policy, boundary test, backend secret-consumer registry, and the lint.yml/pre-commit/pre-push enforcement) as one unit. Preserves the independent web hardening: the gcp_apps_js/frontend/personas workflows keep their baked-secret removal + env-choice/SHA-tagging, and web/frontend, web/personas-open-source, and plugins/apps-js are untouched.
…env-hardening # Conflicts: # .github/workflows/lint.yml # app/config/client_env_policy.yaml # backend/deploy/secret_consumer_registry.yaml # backend/scripts/verify-secret-consumer-registry.py # backend/tests/unit/test_secret_consumer_registry.py # docs/docs.json # scripts/check-public-client-secrets.py # scripts/pre-commit # scripts/pre-push
cursor Bot
pushed a commit
that referenced
this pull request
Jul 1, 2026
Resolve lint.yml conflict by keeping the desktop agent runtime gate alongside main's desktop Rust check, and dropping the reverted public-client secret boundary predicate from #8772. Co-authored-by: David Zhang <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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.
Why
The latest TestFlight builds (1.0.542+969 / +970) shipped broken. Root causes, both from the public-client secret-boundary hardening (#8716, #8717, #8733, #8741):
PUBLIC_prefix and moved Envied's source from.env→.client.env. The Codemagic dashboard still defines the old names, so thePUBLIC_*exports resolved empty,create-public-client-env.shskipped them, and Envied bakednullinto prod.Env.apiBaseUrl!then force-unwrapped to a crash.flutter build ipafailure. The post-build artifact scanner flagged Firebase/SDK constant strings (ERROR_INVALID_CREDENTIAL,PROJECT_TOKEN, …) inside the compiledBatteryWidget.appexMach-O binary as "server-only tokens" — false positives.What this does
codemagic.yaml+app/lib/env/**to the last-good (1.0.533) state — byte-identical, verified 0-diff. The prod build again reads the old var names that are still in the Codemagic dashboard.lint.yml, the git hooks, and the backend registry, so half-reverting would fail CI): scanner scripts,client_env_policy.yaml, the boundary test, the backend secret-consumer registry, and thelint.yml/pre-commit/pre-pushenforcement.openai.dart, the STT provider/polling code, app setup scripts, and env tests to baseline.What is deliberately preserved (independent web hardening)
Not reverted — these removed baked secrets from the web images and are unrelated to the mobile break:
.github/workflows/gcp_apps_js.yml,gcp_frontend.yml,gcp_personas.yml(baked-secret removal from Docker build args + env-choice/SHA tagging)web/frontend/**,web/personas-open-source/**,plugins/apps-js/**Verification
codemagic.yaml+app/lib/envdiff vs the pre-hardening baseline: 0 lines; noPUBLIC_API_BASE_URLleft incodemagic.yaml.dart analyzeon the reverted app code: no errors.flutter test(env + capture_provider): 75/75 pass.Note
This returns the mobile client to its long-standing pre-1.0.542 secret posture (OpenAI/Google client secrets baked into the binary again). That is the status quo that shipped in 1.0.533 and every prior release — not a new exposure — but the underlying hardening should be re-attempted later by adding the
PUBLIC_*vars to Codemagic first, then re-landing, rather than renaming under a live dashboard.