fix(server): return the stored id when creating a push notification config - #1236
Open
ConnorMoss02 wants to merge 1 commit into
Open
ConnorMoss02 wants to merge 1 commit into
ConnorMoss02 wants to merge 1 commit into
Conversation
…onfig Both create handlers returned the caller's request object rather than what the store persisted. The in-memory store defaults an empty id to the task id on the caller's object, so the id survived; the database store copies first and defaults on its private copy, so the response carried no id and reading the config back with it failed validation. Normalize the id in the handler before set_info so the response matches what was stored on every backend.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/request_handlers/default_request_handler.py | 97.90% | 97.92% | 🟢 +0.02% |
| src/a2a/server/request_handlers/default_request_handler_v2.py | 92.53% | 92.65% | 🟢 +0.12% |
| Total | 93.06% | 93.06% | 🟢 +0.01% |
Generated by coverage-comment.yml
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.
Problem
on_create_task_push_notification_configreturns the caller's request object rather than what the store persisted. Both stores default an emptyidto the task id, but the in-memory store does it on the caller's object and the database store does it on a private copy. So on a database-backed server the create response carries noid, and reading the config back with it raisesInvalidParamsError.Fix
Normalize the id in both handlers before
set_info, so the response matches what was stored on any store.Tests
test_create_task_push_notification_config_returns_stored_idin both handler test files, parametrized over the real in-memory and database stores. The[database]case fails with the source reverted.Fixes #1237