Title: Simulator defaults refresh does not reconcile when both simulatorId and simulatorName are set · Issue #357 · getsentry/XcodeBuildMCP · GitHub
Open Graph Title: Simulator defaults refresh does not reconcile when both simulatorId and simulatorName are set · Issue #357 · getsentry/XcodeBuildMCP
X Title: Simulator defaults refresh does not reconcile when both simulatorId and simulatorName are set · Issue #357 · getsentry/XcodeBuildMCP
Description: Context simulatorName is the stable, canonical identity for a simulator selection. simulatorId in .xcodebuildmcp/config.yaml is allowed as a cached/convenience value (useful for sole developers), but it is expected to be reconciled in me...
Open Graph Description: Context simulatorName is the stable, canonical identity for a simulator selection. simulatorId in .xcodebuildmcp/config.yaml is allowed as a cached/convenience value (useful for sole developers), b...
X Description: Context simulatorName is the stable, canonical identity for a simulator selection. simulatorId in .xcodebuildmcp/config.yaml is allowed as a cached/convenience value (useful for sole developers), b...
Opengraph URL: https://github.com/getsentry/XcodeBuildMCP/issues/357
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Simulator defaults refresh does not reconcile when both simulatorId and simulatorName are set","articleBody":"## Context\n\n`simulatorName` is the stable, canonical identity for a simulator selection. `simulatorId` in `.xcodebuildmcp/config.yaml` is allowed as a cached/convenience value (useful for sole developers), but it is expected to be reconciled in memory on each contributor's machine so a committed UUID does not break tools when cloned to a different environment. This reconciliation intentionally never writes back to disk — we don't want config churn from contributors each having different local simulator UUIDs.\n\n## Bug\n\n`refreshSimulatorDefaults` in `src/utils/simulator-defaults-refresh.ts` only reconciles when exactly one of `simulatorId` / `simulatorName` is present:\n\n```ts\nif (!simulatorId \u0026\u0026 simulatorName) {\n // name -\u003e id, in-memory\n}\nif (!simulatorName \u0026\u0026 simulatorId) {\n // id -\u003e name, in-memory\n}\n```\n\nWhen **both** are set in the project config (the common and recommended shape, e.g. `example_projects/iOS_Calculator/.xcodebuildmcp/config.yaml`), neither branch fires. The stale committed `simulatorId` is kept in the session store as-is, and downstream `resolveSimulatorIdOrName` (`src/utils/simulator-resolver.ts:92-113`) short-circuits on it without validating against `simctl`, so the stale UUID is passed directly to `xcrun simctl` on any machine that doesn't happen to have that UUID.\n\n## Expected behaviour\n\nAt MCP runtime bootstrap (`hydrateSessionDefaultsForMcp` in `src/runtime/bootstrap-runtime.ts`), when both `simulatorId` and `simulatorName` are present:\n\n1. Resolve `simulatorName` -\u003e id via `resolveSimulatorNameToId`.\n2. If the resolved id equals the committed `simulatorId`, do nothing.\n3. If it differs, patch `simulatorId` (and recompute `simulatorPlatform` as the existing branches do) in the session store via `sessionStore.setDefaultsIfRevisionForProfile` with `persist: false`.\n\nThe `persist: false` is critical — this is an in-memory override per contributor, not a write-back.\n\n## Proposed fix\n\nExtend `refreshSimulatorDefaults` with a third branch that handles the both-set case, reusing `resolveSimulatorNameToId`. Add unit tests in `src/utils/__tests__/` covering:\n\n- Both set, name resolves to the same id — no patch applied.\n- Both set, name resolves to a different id — in-memory patch updates `simulatorId`; no call to `persistSessionDefaultsPatch`.\n- Both set, `simctl` lookup fails — existing `simulatorId` retained, warning logged.\n\n## Surfaced by\n\nCursor Bugbot review on #349 (https://github.com/getsentry/XcodeBuildMCP/pull/349#discussion_r3139578705), though the bot's framing (committed UUID is a regression) differs from the actual root cause captured here.","author":{"url":"https://github.com/cameroncooke","@type":"Person","name":"cameroncooke"},"datePublished":"2026-04-24T21:24:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/357/XcodeBuildMCP/issues/357"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:da7e7bab-b627-01de-6149-a1af7efc3135 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8794:B2172:1371A50:1BCAA94:6A4CC244 |
| html-safe-nonce | 78c2b2ebd02e293598d5abdd84dc07c96d013f32c04517a3ffb6e298beb60816 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Nzk0OkIyMTcyOjEzNzFBNTA6MUJDQUE5NDo2QTRDQzI0NCIsInZpc2l0b3JfaWQiOiI0OTM1OTA4NTU3MzEwNDQ0MTAwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 983b2cfc510d54f0484e6368ef252de1a5e3088825c81a435646f6f827d35412 |
| hovercard-subject-tag | issue:4325669403 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/XcodeBuildMCP/357/issue_layout |
| twitter:image | https://opengraph.githubassets.com/581534bf0762d0da7e754c60f4372d97c10ff98b15f8c96d2ed15022d3fa98b2/getsentry/XcodeBuildMCP/issues/357 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/581534bf0762d0da7e754c60f4372d97c10ff98b15f8c96d2ed15022d3fa98b2/getsentry/XcodeBuildMCP/issues/357 |
| og:image:alt | Context simulatorName is the stable, canonical identity for a simulator selection. simulatorId in .xcodebuildmcp/config.yaml is allowed as a cached/convenience value (useful for sole developers), b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cameroncooke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/XcodeBuildMCP git https://github.com/getsentry/XcodeBuildMCP.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 945551361 |
| octolytics-dimension-repository_nwo | getsentry/XcodeBuildMCP |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 945551361 |
| octolytics-dimension-repository_network_root_nwo | getsentry/XcodeBuildMCP |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c03e7e569190bc89b638cdd4acb4b6c6b38a170a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width