feat: Add MCP refresh button - #118
Conversation
marekdano
left a comment
There was a problem hiding this comment.
Findings:
1. Refresh toast drops resource/prompt count changes
src/pages/Servers.tsx:235
The success toast picks the "counts" message variant whenever tools, resources, or prompts changed, but the ICU string (mcpServer.refresh.success) only interpolates toolsAdded/toolsUpdated/toolsRemoved. If a refresh only changes resources/prompts (e.g. resourcesAdded: 3, tool counts all 0), every ICU plural block resolves to empty, so the toast renders as "Refreshed {name}. ." — a stray trailing period with no mention of what actually changed. This is duplicated across en-US, es-ES, and pt-BR locale files.
2. Post-success refetch failure surfaces as a refresh failure
src/pages/Servers.tsx:242
await refetch() runs inside the same try block as serversApi.refreshTools(). If the refresh succeeds but the follow-up list refetch throws (e.g. transient network error), the generic catch fires and shows a second, contradicting toast: "Failed to refresh {name}...", right after the success toast already appeared. handleDelete in the same file already wraps its post-success refetch in its own nested try/catch to avoid this exact issue — handleRefresh doesn't follow that precedent and should.
bf5e9aa to
f8efc2a
Compare
Signed-off-by: Gabriel Costa <gabrielcg@proton.me>
Signed-off-by: Gabriel Costa <gabrielcg@proton.me>
f8efc2a to
c194721
Compare
marekdano
left a comment
There was a problem hiding this comment.
Thanks for addressing the previous issues!
The PR is approvable — no blocking issues, just one finding can be fixed here or as follow-up
- Success toast ignores backend
validationErrors(src/pages/Servers.tsx:223)
handleRefresh never reads GatewayRefreshResponse.validationErrors. The backend (gateway_service.py:6592-6722, 7079-7086) can set success=true while populating validation_errors when some discovered tools fail schema validation and are skipped. The frontend only branches on result.success === false, so an admin sees "Refreshed X successfully." with no indication that some tools were silently dropped.
|
Great point, and I agree to make it a follow up work. I'll open an issue now. |
|
Issue: IBM/mcp-context-forge#6802 |
Closes IBM/mcp-context-forge#6550