Skip to content

Paginated mode swallows list-fetch failures: #1954's error UI never fires, and the connect-time load can leave an unhandled rejection #1998

Description

@cliffhall

Found by Copilot reviewing the v2.2.0 milestone merge (#1993), verified against the code.

#1954 made a failed tools/list / prompts/list / resources/list surface an alert with a Retry instead of an empty panel — but it wired the error off the aggregate managed stores only. With the paginatedLists setting on (#1721), those stores are not the display source, so the fix does not apply:

  • ManagedListState deliberately skips its connect-time and list_changed aggregate walk in paginated mode (deferWhenPaginated, core/mcp/state/managedListState.ts:158-166,241-249), so toolsLoadError / promptsLoadError / resourcesLoadError stay null.
  • PagedToolsState / PagedPromptsState / PagedResourcesState — which do drive the sidebar in that mode — have no error state at all. loadPage() has a try { … } finally { this.loading = false } with no catch (core/mcp/state/pagedToolsState.ts:98-124 and siblings), so a rejection propagates to the caller.
  • The connect-time caller is void this.loadPage(undefined) (pagedToolsState.ts:58, pagedPromptsState.ts:46, pagedResourcesState.ts:47), so that rejection is floated — an unhandled rejection, which Enable @typescript-eslint/no-floating-promises so an unhandled rejection can't fail the gate again #1959 is separately trying to make fatal.

Net effect: with pagination on, a failing list still shows an empty sidebar with no alert and no Retry — the exact behavior #1954 set out to remove.

Expected

A failed page load in paginated mode surfaces the same alert + Retry as the aggregate path.

Suggested shape

  1. Give the paged states observable error state (an errorChange event or an error field on the pagination payload), setting it in a catch in loadPage and clearing it on the next success.
  2. Have App.tsx select the error from whichever source is active for the current paginatedLists setting, rather than always reading the managed stores (clients/web/src/App.tsx:4387).
  3. Stop floating the connect-time rejection — the void loadPage(...) calls should route into the same error state.

Repro

test-servers/configs/pagination-http.json with Fetch Lists One Page at a Time on, against a server whose tools/list rejects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2Issues and PRs for v2

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions