Skip to content

fix: copy in-memory push configs so callers cannot mutate stored webhooks - #1218

Open
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/inmemory-push-copy
Open

fix: copy in-memory push configs so callers cannot mutate stored webhooks#1218
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/inmemory-push-copy

Conversation

@anxkhn

@anxkhn anxkhn commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

  • Follow the CONTRIBUTING Guide
  • Conventional Commits title
  • Tests and linter pass
  • Docs updated if necessary

Fixes #1215

Summary

InMemoryPushNotificationConfigStore.set_info appended the caller proto. get_info and get_info_for_dispatch returned those same objects.

After create or get, changing url, token, or id on the request or response proto silently changed the stored webhook. The next notification POST went to the mutated URL.

The SQL store already CopyFroms. InMemoryTaskStore wraps CopyingTaskStoreAdapter for the same reason. The JS SDK cloned on save for this class of bug.

set_info now CopyFroms into a new proto before assign-id and append. get_info and get_info_for_dispatch return copies. Default id assignment stays on the stored copy, not the caller.

Testing

Added test_set_info_copies_caller_and_returned_config.

uv run pytest tests/server/tasks/test_inmemory_push_notifications.py -q

21 passed.

…ooks

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
@anxkhn
anxkhn requested a review from a team as a code owner August 27, 2026 21:10
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

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]: In-memory push store keeps the caller object so later mutations rewrite stored webhooks

1 participant