Skip to content

fix(client): seed AppBridge host context before connect#201

Open
he-yufeng wants to merge 1 commit into
MCP-UI-Org:mainfrom
he-yufeng:fix/app-renderer-host-context-race
Open

fix(client): seed AppBridge host context before connect#201
he-yufeng wants to merge 1 commit into
MCP-UI-Org:mainfrom
he-yufeng:fix/app-renderer-host-context-race

Conversation

@he-yufeng

Copy link
Copy Markdown

Summary

  • seed AppBridge with the initial hostContext so ui/initialize has the value before the iframe transport connects
  • keep later hostContext updates flowing through setHostContext, while ignoring the pre-connect Not connected notification race
  • add AppRenderer coverage for constructor seeding and the not-connected sync path

Fixes #195

To verify

  • pnpm --filter @mcp-ui/client test -- AppRenderer
  • pnpm --filter @mcp-ui/client build
  • pnpm --filter @mcp-ui/client lint
  • git diff --check

@he-yufeng

Copy link
Copy Markdown
Author

Quick follow-up: this is still scoped to seeding the AppBridge host context before connect, with a client test covering the ordering.

Could a maintainer take a look when convenient?

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.

AppRenderer setHostContext effect runs before AppFrame has connected the bridge — Not connected on first mount

1 participant