Skip to content

The 1.17.0 TestFlight build shipped with no Mapbox token — .env.production never reaches the EAS worker #686

Closed

Description

@thinkclay

The 1.17.0 / 11700 build now on TestFlight has no Mapbox token in it. The map is a headline feature of the app and it is dead in that build. Google sign-in is very likely broken too.

Evidence — from the shipped binary, not from config

I pulled the artifact EAS produced (pUsq0BkG….ipa, 38 MB) apart and scanned the whole .app:

mapbox token pk.*            ABSENT everywhere
mapbox token sk.*            ABSENT everywhere
google client id             ABSENT everywhere

Info.plist:
  MBXAccessToken             ABSENT
  RNMapboxMapsDownloadToken  ABSENT
  GIDClientID                ABSENT

supabase url (auth.scaffald.com)   PRESENT   <- declared in eas.json
posthog host (app.posthog.com)     PRESENT   <- declared in eas.json

CFBundleShortVersionString  1.17.0
CFBundleVersion             11700

The pattern is exact: everything eas.json declares arrived; nothing else did.

One thing that looks like a counter-example is not. com.googleusercontent.apps.163454683152-… is registered as a URL scheme — but that is the hardcoded fallback at app.config.ts:378, not proof that env arrived. The client IDs the JS side actually needs are absent.

Cause

.env.production is gitignored. It never reaches the EAS worker, so the dotenv.config() in app.config.ts finds nothing there. Only two sources reach a cloud build:

  1. the env block of the profile in eas.json
  2. EAS environment variables (eas env:create --environment production)

EAS currently holds only APPLE_SECRET, POSTHOG_KEY_PROD, RESEND_API_KEY for production.

Why nobody caught it

scripts/ship-ios.sh asserted the opposite in its own comment — "the rest (Mapbox, Google OAuth, redirect URIs) come from .env.production at build time". So it read that file, confirmed four variables, live-pinged the Mapbox token and got a 200, printed a row of ticks, and then shipped a binary containing none of them.

A check that is confident and wrong is worse than no check. I ran it before shipping, believed it, and reported the build as verified.

#687 rewrites the check to ask EAS what the build will actually see, and to fail with the exact remediation command per variable.

Remediation — needs a human

These are API tokens, so registering them is not something to automate away into a script's side effects. Values are in .env.production in the primary checkout:

cd apps/scaffald
pnpm exec eas env:create --environment production \
  --name EXPO_PUBLIC_MAPBOX_TOKEN --value '<value>' --visibility sensitive
pnpm exec eas env:create --environment production \
  --name EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID --value '<value>' --visibility sensitive
pnpm exec eas env:create --environment production \
  --name EXPO_PUBLIC_GOOGLE_IOS_SCHEME --value '<value>' --visibility sensitive
pnpm exec eas env:create --environment production \
  --name EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID --value '<value>' --visibility sensitive

Acceptance

  • The four variables registered in the EAS production environment
  • pnpm ship:ios --no-build passes on its own merits
  • A rebuild produced and the binary re-inspected — MBXAccessToken present in Info.plist. Config review is what missed this; only the artifact settles it.
  • That build replaces 11700 on TestFlight (bump to 1.17.1, since 11700 is spent)
  • Check whether the same gap affects the web deploy, which reads the same variables by a different route

Scope

Android is affected identically — the profile env is shared, so a Play build today would ship the same way. I cancelled the first Android build (41d6ea5b) on discovering this rather than spend minutes on an artifact that could not be trusted.

Activity

  1. added
    agent-ready
    on Sep 1, 2026
  2. thinkclay commented on Sep 1, 2026

    @thinkclay
    ContributorAuthor

    Web is not affected. Checked rather than assumed — one of the acceptance items above, now answerable.

    scripts/deploy-web-eas.sh:94 builds the web bundle locally:

    pnpm exec dotenv -e "../../${ENV_FILE}" -- pnpm exec expo export --platform web

    so .env.production is loaded at export time on the developer's machine, and the EXPO_PUBLIC_* values are baked into the bundle before anything is uploaded.

    Verified against the live site by downloading what scaffald.com actually serves (17 MB of JS) and scanning it — presence only:

    mapbox token (pk.*)        PRESENT
    supabase url               PRESENT
    google oauth client id     ABSENT   <- expected; web OAuth goes through
                                           Supabase's hosted flow, so no client
                                           id needs to reach the browser bundle
    

    So the asymmetry is precise, and it is the whole bug:

    Target Where it builds Sees .env.production?
    Web locally, via dotenv -e yes
    iOS / Android EAS worker no

    The web app has been fine this whole time, which is part of why this went unnoticed — the map works when you check it in a browser.

    Ticking that box; the native items stand.

  3. thinkclay commented on Sep 1, 2026

    @thinkclay
    ContributorAuthor

    Fixed and verified from the binary, which is what missed it the first time.

    1.17.1 / 11701 (build a57c5a09), same inspection as before:

    Check 11700 11701
    mapbox token in bundle ABSENT PRESENT
    google client id ABSENT PRESENT
    supabase url PRESENT PRESENT

    RNMapboxMapsDownloadToken is now absent from Info.plist, and that is correct — see #694; it is a build-time credential that should never have been sourced from the public runtime token, and should not ship in the app.

    It was not a clean landing

    Registering the four variables broke both native builds immediately — iOS at Install pods, Android at Run gradlew. Making EXPO_PUBLIC_MAPBOX_TOKEN reach the worker also populated RNMapboxMapsDownloadToken, which fell back to it. Asked Mapbox directly:

    token kind      pk.
    scopes          0
    DOWNLOADS:READ  NO
    downloads API   HTTP 403
    

    An absent download token works (the 10.1.x SDK resolves unauthenticated); a wrong one 403s. Every green build up to 11700 was relying on that fallback never firing. #694 removes it.

    Worth recording: ship-ios.sh had been warning MAPBOX_DOWNLOADS_TOKEN was missing the whole time. The warning was accurate — it described a latent problem, and I read past it twice as noise.

    Closing. #509 still wants a real sk. token with DOWNLOADS:READ, but nothing is blocked on it today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions