Skip to content

fix(app): decouple MCP resource refresh from toggle - #48391

Open
mapix-etnc wants to merge 1 commit into
anomalyco:devfrom
mapix-etnc:desktop-mcp-toggle
Open

fix(app): decouple MCP resource refresh from toggle#48391
mapix-etnc wants to merge 1 commit into
anomalyco:devfrom
mapix-etnc:desktop-mcp-toggle

Conversation

@mapix-etnc

Copy link
Copy Markdown

Issue for this PR

Fixes #48386

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After an MCP toggle connects, the Desktop UI now awaits only the MCP status refresh. Resource catalog discovery runs as a non-blocking best-effort refresh, so a slow or unsupported resources/list from any connected server cannot block the toggle or make it appear to fail. Resource refresh rejections are caught so they do not become unhandled rejections.

The regression tests cover the three toggle actions, pending connections, non-blocking resource discovery, and a rejected refreshResources() call.

How did you verify your code works?

  • cd packages/app && bun test --conditions=solid --preload ./happydom.ts ./src/context/global-sync/mcp.test.ts
  • bun --cwd packages/app typecheck
  • bunx prettier --check packages/app/src/context/global-sync/mcp.ts packages/app/src/context/global-sync/mcp.test.ts packages/app/src/context/server-sync.tsx
  • Pre-push bun turbo typecheck

Screenshots / recordings

Not applicable; this is a behavior-only fix with no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

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.

Desktop MCP toggle can fail or block on resource catalog refresh

1 participant