Skip to content

fix(push): cap push notification configs per task - #405

Open
ez-lbz wants to merge 2 commits into
a2aproject:mainfrom
ez-lbz:fix/push-config-limit
Open

fix(push): cap push notification configs per task#405
ez-lbz wants to merge 2 commits into
a2aproject:mainfrom
ez-lbz:fix/push-config-limit

Conversation

@ez-lbz

@ez-lbz ez-lbz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What changed

1. Cap push notification configs per task

Problem:

InMemoryPushConfigStore.Save accepted an unlimited number of push configs per task, letting a client grow the store without bound.

Fix (a2asrv/push/store.go, a2asrv/push/store_test.go):

  • Added maxPushConfigsPerTask = 50; new insertions beyond the limit are rejected with a2a.ErrInvalidParams (task %s already has the maximum number of push notification configs (50)).
  • Updating an existing config at the limit is still allowed; the limit applies to new insertions only.
  • Added TestInMemoryPushConfigStore_MaxConfigsPerTask and reduced the concurrency test to 50 goroutines so every concurrent save still succeeds.

Testing

  • go test ./a2asrv/push/ ./a2asrv/... ./a2agrpc/... — all pass.
  • New TestInMemoryPushConfigStore_MaxConfigsPerTask covers rejection beyond the limit, update-at-limit, and count stability.

Behavior change: the 51st distinct push config for a task is rejected with an invalid-params error.

ez-lbz added 2 commits August 11, 2026 00:20
Save allowed an unlimited number of push configs per task, letting a
client grow the store without bound. Enforce maxPushConfigsPerTask (50)
per task: new insertions beyond the limit return an ErrInvalidParams
error while updating an existing config at the limit stays allowed.
Update the concurrent-creation test to stay within the limit and add a
regression test for the cap.

Behavior change: creating a 51st push config for a task now fails with
an invalid-params error.
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.

1 participant