Skip to content

fix(xcode-ide): suppress listChanged resync during manual bridge disconnect#344

Open
shaun0927 wants to merge 1 commit intogetsentry:mainfrom
shaun0927:fix/bridge-disconnect-resync
Open

fix(xcode-ide): suppress listChanged resync during manual bridge disconnect#344
shaun0927 wants to merge 1 commit intogetsentry:mainfrom
shaun0927:fix/bridge-disconnect-resync

Conversation

@shaun0927
Copy link
Copy Markdown

Summary

Fixes #343.

xcode_tools_bridge_disconnect is documented as the bridge tool that disconnects the Xcode IDE bridge and unregisters proxied xcode_tools_* tools. In the current implementation, the explicit disconnect path still allows the bridge invalidation callback to feed back into syncTools({ reason: "listChanged" }).

That makes a manual disconnect behave like a remote catalog refresh instead of a stable disconnected state.

Why this change belongs here

The current bridge tool contract separates:

  • xcode_tools_bridge_disconnect for explicit disconnect + unregister
  • xcode_tools_bridge_sync for explicit/manual re-sync

Allowing listChanged-driven resync during a manual disconnect collapses those semantics and weakens the deterministic lifecycle behavior the repo has been tightening in the recent MCP lifecycle work.

Changes

  • suppress listChanged-driven resync while a manual bridge disconnect is in progress
  • clear that suppression on the next explicit startup/manual sync
  • add a focused regression test covering the manager callback flow
  • record the fix in CHANGELOG.md under Unreleased

Testing

  • npm run format
  • npm run lint
  • npm run generate:version
  • npm run typecheck
  • npm run build
  • npm run docs:check
  • npm test

Validation note

Before applying the fix, I locally reproduced the problem by triggering disconnectTool() and observing the manager callback still schedule syncTools({ reason: "listChanged" }). The new regression test locks that behavior out so an explicit disconnect remains disconnected until the next intentional sync path.

xcode_tools_bridge_disconnect is documented as a disconnect-and-unregister
operation, but the bridge close callback still fed back into the listChanged
resync path. That made an explicit manual disconnect behave like a transient
reconnect event instead of a stable disconnected state.

Suppress listChanged-driven resync while a manual disconnect is in progress,
then clear that suppression on the next explicit startup/manual sync. Add a
focused regression test for the manager callback flow and record the fix under
Unreleased.

Constraint: The xcode-ide bridge keeps a live invalidation callback even during explicit disconnect teardown
Rejected: Remove the invalidation callback entirely | would break legitimate remote catalog refresh handling
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Preserve the semantic split between bridge-disconnect and bridge-sync; disconnect should not implicitly reconnect
Tested: npm run format; npm run lint; npm run generate:version; npm run typecheck; npm run build; npm run docs:check; npm test
Not-tested: End-to-end interaction with a real Xcode mcpbridge instance outside mocked/unit coverage
@shaun0927 shaun0927 force-pushed the fix/bridge-disconnect-resync branch from d476264 to 9466aef Compare April 16, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xcode_tools_bridge_disconnect triggers listChanged resync and undermines manual disconnect semantics

1 participant