a2aproject / a2aproject/a2a-js

[Bug]: REST create push config ignores path taskId

Offen
#680 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
613
Forks
169
Ø Merge
1 T. 6 Std.
Gemergte PRs (30 T.)
21

Beschreibung

### What happened?

`POST /tasks/:taskId/pushNotificationConfigs` parses only the JSON body (`TaskPushNotificationConfig.fromJSON(req.body)`). `req.params.taskId` is never copied onto the config. `fromJSON` defaults a missing taskId to `""`, and after #629 empty IDs are `RequestMalformedError`.

The proto HTTP mapping is `post: "/tasks/{task_id=*}/pushNotificationConfigs"` with `body: "*"`, so transcoding clients put task_id in the URL and may omit it from the body. Same-SDK RestTransport sends taskId in both places, which is why in-repo tests pass. The v0.3 Express handler has the same hole.

**Repro**
Create a task, then `POST /tasks//pushNotificationConfigs` with body `{ "url": "https://example.test/hook" }` and no taskId field.

Observed: 400 "Task ID is required".
Expected: 201 and a stored config whose taskId is the path id.

### Relevant log output

n/a.

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.