Skip to content

fix: clone push notification configs before storing - #662

Merged
JakubWorek merged 1 commit into
a2aproject:mainfrom
anxkhn:fix/push-store-save-clone
Aug 20, 2026
Merged

JakubWorek merged 1 commit into
a2aproject:mainfrom
anxkhn:fix/push-store-save-clone

Conversation

@anxkhn

@anxkhn anxkhn commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

InMemoryPushNotificationStore.save retained the caller's TaskPushNotificationConfig object. Mutating that object after saving could silently change the stored webhook URL, token, or authentication data.

This change stores a deep clone in src/server/push_notification/push_notification_store.ts while preserving the generated ID on the caller's object. DefaultRequestHandler.sendMessage and sendMessageStream also clone inline configurations before passing them to a store, preventing aliasing in custom implementations.

Regression coverage verifies input isolation, generated-ID behavior, and inline sendMessage configuration handling.

Tested with:

npx --no-install vitest run test/server/push_notification_store.spec.ts test/server/request_handler/push_notification_config.spec.ts

@anxkhn
anxkhn requested a review from a team as a code owner August 19, 2026 20:40
@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@JakubWorek
JakubWorek force-pushed the fix/push-store-save-clone branch from af30287 to ab812ea Compare August 20, 2026 09:21

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

Hi @anxkhn, thank you for your contribution, lgtm, approved

@JakubWorek
JakubWorek merged commit 4d175a0 into a2aproject:main Aug 20, 2026
16 checks passed
This was referenced Aug 20, 2026
bartek-gralewicz added a commit that referenced this pull request Aug 26, 2026
🤖 I have created a release *beep* *boop*
---


## [1.1.0](v1.0.1...v1.1.0)
(2026-08-26)


### Features

* make event bus keep-alive states configurable
([#669](#669))
([f844dad](f844dad)),
closes [#620](#620)


### Bug Fixes

* Add serialization for listTasks input/output parameters.
([#610](#610))
([c863497](c863497))
* clone push notification configs before storing
([#662](#662))
([4d175a0](4d175a0))
* **compat/v0_3/translate:** add null and undefined checks to array and
string fields ([#618](#618))
([108736b](108736b))
* **deps:** replace `uuid` package with `crypto.randomUUID()`
([#665](#665))
([636b060](636b060))
* Do not filter tasks in ListTasks if task state is unspecified
([#622](#622))
([1c6eb32](1c6eb32))
* **errors:** global error branding via Symbol.hasInstance to fix
instanceof checks across bundle entry points
([#612](#612))
([cc33173](cc33173))
* **scripts:** update generate script to use buf and remove obsolete
generateTypes ([#653](#653))
([8bf3cd3](8bf3cd3))
* **server:** send full Task on every v0.3 push trigger
([#658](#658))
([b3afbe4](b3afbe4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: bartek-gralewicz <[email protected]>
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.

2 participants