Skip to content

fix(rest): forward pageSize and pageToken for push-notification config listing - #701

Merged
JakubWorek merged 3 commits into
a2aproject:mainfrom
OsamaAnsar:fix/rest-push-config-pagination
Oct 9, 2026
Merged

JakubWorek merged 3 commits into
a2aproject:mainfrom
OsamaAnsar:fix/rest-push-config-pagination

Conversation

@OsamaAnsar

Copy link
Copy Markdown
Contributor

What

The REST transport silently drops pageSize and pageToken when listing a task's push-notification configs:

  • RestTransport.listTaskPushNotificationConfig sends GET /tasks/:taskId/pushNotificationConfigs with no query string, even when pageSize/pageToken are supplied.
  • The Express restHandler always invokes the request handler with pageSize: 0, pageToken: '' regardless of the request's query parameters.

Pagination works on the JSON-RPC and gRPC transports, so REST behaved inconsistently — and there was no way to request a bounded page or follow a returned nextPageToken. Per A2A spec §11.5, GET request parameters must be sent as camelCase query parameters (pageSize, pageToken).

Changes

  • Client (RestTransport.listTaskPushNotificationConfig): append pageSize/pageToken as query params, mirroring the existing listTasks implementation. ListTaskPushNotificationConfigsRequest.pageSize has no proto3 optional modifier (unlike ListTasksRequest.pageSize), so 0 is its unspecified value — only sent when > 0.
  • Server (RestTransportHandler.listTaskPushNotificationConfigs): take a queryParams object like listTasks already does, and parse pageSize/pageToken/tenant from it instead of hard-coding.

The v0.3 compat REST layer is intentionally left alone — its wire response is a bare array with no pagination fields.

Testing

  • New unit tests: client sends the query params; the REST transport handler forwards pageSize/pageToken/tenant; the Express route passes them through end to end.
  • npx vitest run — 68 files / 1529 tests pass.
  • npx tsc --noEmit + -p tsconfig.test.json, npx eslint ., npm run build — all clean.

Closes #700

…g listing

The REST transport dropped `pageSize`/`pageToken` when listing a task's
push-notification configs — the client sent no query string, and the
Express handler always invoked the request handler with `pageSize: 0`,
`pageToken: ''` regardless of the URL's query parameters. Pagination
worked on JSON-RPC and gRPC but silently no-op'd on REST, and there was
no way to request a bounded page or follow a returned nextPageToken.

Client (`RestTransport.listTaskPushNotificationConfig`): append
`pageSize`/`pageToken` as camelCase query params, mirroring `listTasks`
and A2A spec §11.5. `pageSize` has no proto3 `optional` modifier, so 0
is its "unspecified" value — only send it when > 0.

Server (`RestTransportHandler.listTaskPushNotificationConfigs`): take a
`queryParams` object like `listTasks` already does and parse
`pageSize`/`pageToken`/`tenant` from it instead of hard-coding them.

Closes a2aproject#700
@OsamaAnsar
OsamaAnsar requested a review from a team as a code owner September 5, 2026 13:30
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

Base PR Delta
src/client/transports/rest_transport.ts 92.47% 92.6% 🟢 +0.13%
src/server/transports/rest/rest_transport_handler.ts 98.78% 98.88% 🟢 +0.10%
Total 86.71% 86.73% 🟢 +0.02%

Generated by coverage-comment.yml

@JakubWorek JakubWorek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting the PR, pls add pageSize validation in rest_transport_handler

…isting

Number() let abc (NaN), -5 and 1.5 through to the request handler. Validate it as a non-negative integer, like the other pagination parameters.
@OsamaAnsar

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I added the validation in 00cd6cf: pageSize on the push-notification config list now goes through a non-negative integer check, so abc, -5 and 1.5 are rejected with a RequestMalformedError instead of reaching the request handler. An absent or empty pageSize still means 0 (server default). Tests cover the rejected values and the empty case, and I merged main into the branch too.

@JakubWorek
JakubWorek merged commit 8a4e696 into a2aproject:main Oct 9, 2026
21 checks passed
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.

[Bug]: REST push-notification config listing ignores pageSize and pageToken

2 participants