Skip to content

fix(compat): percent-encode ids in v0.3 REST push config delete path - #1486

Merged
Iwaniukooo11 merged 2 commits into
a2aproject:mainfrom
saquibjawedbit:fix/compat-rest-delete-quote-ids
Nov 18, 2026
Merged

Iwaniukooo11 merged 2 commits into
a2aproject:mainfrom
saquibjawedbit:fix/compat-rest-delete-quote-ids

Conversation

@saquibjawedbit

Copy link
Copy Markdown
Contributor

Description

The v0.3 REST client built the DELETE /v1/tasks/{task_id}/pushNotificationConfigs/{id} path without percent-encoding the ids. #1458 added _quote_id to the other six path builders in compat/v0_3/rest_transport.py, but the delete call was missed (its server route only landed later, in #1442). So deleting alerts#ops sent .../pushNotificationConfigs/alerts#ops; the #ops became a URL fragment and the server deleted alerts instead, leaving alerts#ops in place. Ids with ? or % are mangled the same way.

Fix: wrap both ids in _quote_id, as the get, list and create calls already do.

Testing

New case in the existing path-encoding tests in tests/compat/v0_3/test_rest_transport.py (real handler + real client: create alerts and alerts#ops, delete alerts#ops, check what's left).

Before the fix:

AssertionError: assert ['alerts#ops'] == ['alerts']
1 failed, 2 passed

After:

3 passed

Full suite on main (a59bb68):

$ pytest tests --ignore=tests/integration/cross_version
2618 passed, 215 skipped, 4 xfailed, 1 xpassed

ruff check and ruff format pass.

Fixes #1485 🦕

`CompatRestTransport.delete_task_push_notification_config` still put the
task id and the push config id into the URL path as raw text. a2aproject#1458
encoded ids at the other six path sites, but the delete route was only
added to the v0.3 REST server by a2aproject#1442, so this one was left out.

An id containing `#`, `?` or `%` then names a different resource:
deleting the config `alerts#ops` sends
`DELETE /v1/tasks/t1/pushNotificationConfigs/alerts` and removes the
config `alerts`, leaving `alerts#ops` in place.

Encode both ids with the existing `_quote_id` helper, as the get, list
and create calls already do. Ids without reserved characters produce the
same URL as before.
@saquibjawedbit
saquibjawedbit requested a review from a team as a code owner November 17, 2026 08:26
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@Iwaniukooo11 Iwaniukooo11 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.

LGTM

@Iwaniukooo11
Iwaniukooo11 merged commit 270972d into a2aproject:main Nov 18, 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]: v0.3 REST client deletes the wrong push config when the id contains #, ? or %

2 participants