Repository navigation
fix(compat): percent-encode ids in v0.3 REST push config delete path - #1486
Merged
Iwaniukooo11 merged 2 commits intoNov 18, 2026
Merged
Iwaniukooo11 merged 2 commits into
Iwaniukooo11 merged 2 commits into
Conversation
`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.
🧪 Code Coverage (vs
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The v0.3 REST client built the
DELETE /v1/tasks/{task_id}/pushNotificationConfigs/{id}path without percent-encoding the ids. #1458 added_quote_idto the other six path builders incompat/v0_3/rest_transport.py, but the delete call was missed (its server route only landed later, in #1442). So deletingalerts#opssent.../pushNotificationConfigs/alerts#ops; the#opsbecame a URL fragment and the server deletedalertsinstead, leavingalerts#opsin 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: createalertsandalerts#ops, deletealerts#ops, check what's left).Before the fix:
After:
Full suite on main (a59bb68):
ruff checkandruff formatpass.CONTRIBUTINGGuide.Fixes #1485 🦕