GPT-5 finding
Debounced search keeps stale results visible and may paginate wrong page after query change
- app/src/components/channels/mcp/McpCatalogBrowser.tsx
- app/src/components/channels/mcp/McpCatalogBrowser.tsx
When query changes, the component triggers a debounced fetch but does not clear servers or reset page until the response arrives. During that window, prior results and a Load more button may remain, allowing the user to request page+1 for the new query using an outdated page value, mixing results. This is a subtle correctness/UX issue that complicates state reasoning.
Recommendation
On query change, immediately clear servers and reset page/totalPages (e.g., setServers([]); setPage(1); setTotalPages(1)) and hide Load more until the first response for the new query arrives. Optionally, track a requestId to ignore late responses from prior queries.