Skip to content

fix(rest): ensure taskId is correctly set from path parameters when creating push notification configs - #740

Merged
JakubWorek merged 2 commits into
mainfrom
jakubworek/fix-create-push-config-rest
Sep 22, 2026
Merged

JakubWorek merged 2 commits into
mainfrom
jakubworek/fix-create-push-config-rest

Conversation

@JakubWorek

Copy link
Copy Markdown
Member

Description

ACTS conformance testing caught this: every push-notification test failed against the REST binding with 400 "Task ID is required", while JSON-RPC and gRPC passed.

POST /tasks/:taskId/pushNotificationConfigs declared the path param and documented it, then built the config from req.body alone:

const params = TaskPushNotificationConfig.fromJSON(req.body ?? {});

The proto binds task_id into the URL:

post: "/tasks/{task_id=*}/pushNotificationConfigs"
body: "*"

The sibling list, get and delete routes have always read req.params.taskId; this one was the outlier, and the only route that rebuilds a whole request message from the body.

It went unnoticed because our own REST client sends taskId in the path and the body, so a2a-js could always talk to itself.

Fix: merge the path param before parsing, with the path winning over a body that repeats it, since the URL is what addressed the resource.

Before:

ACTS a2a-js / rest — 111 tests in 19076ms
  MUST   46/49 passed (3 failed, 16 skipped)
  SHOULD 27/27 passed (6 skipped)
  MAY    5/13 passed (8 failed)
  => NOT CONFORMANT
    CORE-SEND-004: expected an error, but the call succeeded
    SEC-PUSH-001: expected a response body, got error an unnamed error: Task ID is required
    SEC-PUSH-002: expected a response body, got error an unnamed error: Task ID is required
    PUSH-CFG-001: step 'set-config' cannot capture 'configId': no value at path 'id' in the response
    PUSH-CFG-002: step 'set-config' cannot capture 'configId': no value at path 'id' in the response
    PUSH-CFG-003: step 'set-config' cannot capture 'configId': no value at path 'id' in the response
    PUSH-LIST-001: step 'set-config' cannot capture 'configId': no value at path 'id' in the response
    PUSH-IDEM-001: step 'set-config' cannot capture 'configId': no value at path 'id' in the response
    PUSH-DELIV-001: expected a response body, got error an unnamed error: Task ID is required
    PUSH-DELIV-002: expected a response body, got error an unnamed error: Task ID is required
    PUSH-DELIV-003: expected a response body, got error an unnamed error: Task ID is required

After:

ACTS a2a-js / rest — 111 tests in 25199ms
  MUST   48/49 passed (1 failed, 16 skipped)
  SHOULD 27/27 passed (6 skipped)
  MAY    13/13 passed
  => NOT CONFORMANT
    CORE-SEND-004: expected an error, but the call succeeded

@JakubWorek
JakubWorek requested a review from a team as a code owner September 21, 2026 15:16
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

Base PR Delta
src/client/transports/json_rpc_transport.ts 77.05% 79.88% 🟢 +2.83%
src/server/express/rest_handler.ts 87.78% 87.89% 🟢 +0.11%
src/server/grpc/grpc_service.ts 80.82% 100% 🟢 +19.18%
src/server/transports/jsonrpc/jsonrpc_transport_handler.ts 83.07% 97.43% 🟢 +14.36%
src/types/protojson.ts 50.4% 52.32% 🟢 +1.92%
Total 85.45% 86.37% 🟢 +0.92%

Generated by coverage-comment.yml

@JakubWorek
JakubWorek merged commit 4a42ec1 into main Sep 22, 2026
16 checks passed
@JakubWorek
JakubWorek deleted the jakubworek/fix-create-push-config-rest branch September 22, 2026 09:12
bartek-gralewicz pushed a commit that referenced this pull request Sep 24, 2026
🤖 I have created a release *beep* *boop*
---


## [1.2.1](v1.2.0...v1.2.1)
(2026-09-24)


### Bug Fixes

* issue that status or artifact events do not propagate the metatadata
to the task ([#748](#748))
([72588af](72588af))
* **jsonrpc:** return JSON-RPC errors as HTTP 200 and dispatch on
A2A-Version ([#747](#747))
([733259d](733259d))
* **rest:** ensure taskId is correctly set from path parameters when
creating push notification configs
([#740](#740))
([4a42ec1](4a42ec1))
* **server:** add optional media type validation against agent
defaultInputModes
([#745](#745))
([27659a2](27659a2))
* validate JSON-RPC response version
([#698](#698))
([e0cdc91](e0cdc91))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants