a2aproject / a2aproject/a2a-js

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

未关闭 适合新手
#700 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
613
派生
169
平均合并
1 天 6 小时
30 天内合并 PR
21

描述

## What happened

The REST transport silently drops `pageSize` and `pageToken` when listing push-notification configurations. A call that supplies `pageSize: 7` and `pageToken: "cursor-abc"` sends `GET /tasks/task-1/pushNotificationConfigs` with no query string. The REST server also invokes the request handler with `pageSize: 0` and an empty `pageToken` even when the HTTP request contains those query parameters, so callers cannot request a page or continue from a cursor.

## What I expected

When `pageSize` and/or `pageToken` are supplied, the REST client should transmit them as URL-encoded camelCase query parameters, and the REST server should pass those values through to `ListTaskPushNotificationConfigsRequest`. A caller should be able to retrieve a bounded page and follow the returned `nextPageToken`.

## Steps to reproduce

1. Create a `RestTransport` with a custom `fetch` implementation that records the requested URL and returns a successful JSON response.
2. Call `listTaskPushNotificationConfig({ tenant: "", taskId: "task-1", pageSize: 7, pageToken: "cursor-abc" })`.
3. Observe that the requested URL is `/tasks/task-1/pushNotificationConfigs` rather than including `?pageSize=7&pageToken=cursor-abc`.
4. Alternatively, send `GET /tasks/task-1/pushNotificationConfigs?pageSize=7&pageToken=cursor-abc` to an Express server using `restHandler` and inspect the request-handler arguments; they still contain `pageSize: 0` and `pageToken: ""`.

## Additional context

The A2A specification section 11.5 (Query Parameter Naming for Request Parameters) requires GET operation request parameters to be sent as query parameters and defines the camelCase names `pageSize` and `pageToken`: https://github.com/a2aproject/A2A/blob/main/docs/specification.md#115-query-parameter-naming-for-request-parameters

The same request fields are available through the JSON-RPC and gRPC transports, so silently ignoring them in REST makes pagination behavior differ across transports. If pagination is intentionally unsupported for this endpoint, the public REST API should document or reject those inputs instead of ignoring them.

贡献指南

打开贡献指南

调研方向

Look at the REST transport code that handles the listTaskPushNotificationConfig call, likely in a file like src/transport/rest.ts or similar. The bug is that pageSize and pageToken parameters are not being serialized into the query string. Also check the server-side restHandler to see why it's not parsing them. The fix involves ensuring these fields are included in the URL query parameters on the client and correctly extracted on the server. Test by running the provided reproduction steps.

由索引模型根据 Issue 内容生成。

评估

技术栈
express, javascript, node.js, typescript
领域
api, backend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
描述清楚
新手友好度
70/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。