t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID is validated but never applied — personal-team iOS builds still sign as the T3 team

Open fkxr-dev opened this issue 4 months ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/mobile (not in the issue-form dropdown; filed via CLI — closest option would be "Build, CI, or release tooling")

Steps to reproduce

  1. Fresh clone, no root .env. Follow the personal-team instructions in apps/mobile/README.md:
    T3CODE_IOS_PERSONAL_TEAM=1 \
    T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID=com.example.t3code \
    vp run ios:release
    
    (the expo prebuild step is where the gaps show up)
  2. Inspect the generated apps/mobile/ios/T3Code.xcodeproj/project.pbxproj and apps/mobile/ios/T3Code/T3Code.entitlements.

Expected behavior

Per the README: the build uses the bundle identifier from T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID, is not pinned to the T3 Tools signing team, and omits the push entitlement (alongside the widget extension and Sign in with Apple).

Actual behavior

Three gaps, all in apps/mobile/app.config.ts:

  1. The bundle ID override is validated but never applied. The config validates T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID against a reverse-DNS pattern and throws a helpful error when it is missing — but personalTeamBundleIdentifier is never referenced again. ios.bundleIdentifier is always variant.iosBundleIdentifier, so the generated project keeps com.t3tools.t3code.
  2. ios.appleTeamId is set unconditionally, so DEVELOPMENT_TEAM stays ARK85ZXQ4Z even in personal-team mode and non-interactive expo run:ios fails signing for anyone outside the T3 team. (The comment on that line says the pin exists to prevent falling back to a personal team — but it also applies when the user explicitly opted into a personal-team build.)
  3. The push entitlement survives the strip. withoutIosPersonalTeamCapabilities.cjs is registered last in the plugins array, and same-type mods run last-registered-first (the config's own comment about gating Clerk appleSignIn at the source explains this ordering) — so expo-notifications re-adds aps-environment after the strip plugin runs. expo config --type prebuild with the flag set shows extra.iosPersonalTeamBuild: true next to bundleIdentifier: 'com.t3tools.t3code', and the generated entitlements still contain aps-environment.

What does work in personal-team mode: the widget target/app-group entitlements are skipped and Sign in with Apple is gated at the Clerk plugin.

Impact

Minor bug or occasional failure — it fully blocks the documented from-source device build for outside contributors unless they hand-patch the generated ios/ project.

Version or commit

main @ 3513fa04f

Environment

macOS 15.7.4, Xcode 26.2, Node 26.0.0, pnpm 11.10.0, CocoaPods 1.17.0

Logs or stack traces

n/a — confirmed by inspecting the generated project output rather than a crash.

Workaround

After prebuild: rewrite PRODUCT_BUNDLE_IDENTIFIER and DEVELOPMENT_TEAM in project.pbxproj, delete aps-environment from T3Code.entitlements, then build with xcodebuild. Verified working on-device (paid individual team).


Found during an agent-assisted from-source build (Claude Code); all of the above was verified against the generated project on the commit noted. Happy to send a small focused PR (apply the env bundle ID, drop appleTeamId when the flag is set) if that would be welcome.

fkxr-dev avatar Jul 15 '26 06:07 fkxr-dev

please dont just send agents over a random codebase and file issues you haven't even encountered jfc

juliusmarminge avatar Jul 15 '26 10:07 juliusmarminge