Skip to content

Commit f67e128

Browse files
committed
Code review fixes
1 parent 71c477d commit f67e128

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
308308
kind = etai.eventType();
309309

310310
// Store push notification config for newly created tasks (mirrors streaming logic)
311-
if (kind instanceof Task createdTask && shouldAddPushInfo(params)) {
311+
// Only for NEW tasks - existing tasks are handled by initMessageSend()
312+
if (mss.task() == null && kind instanceof Task createdTask && shouldAddPushInfo(params)) {
312313
LOGGER.debug("Storing push notification config for new task {}", createdTask.getId());
313314
pushConfigStore.setInfo(createdTask.getId(), params.configuration().pushNotificationConfig());
314315
}

server-common/src/test/java/io/a2a/server/requesthandlers/DefaultRequestHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,8 @@ void testMessageStoresPushNotificationConfigForExistingTask() throws Exception {
946946
List<PushNotificationConfig> storedConfigs = pushConfigStore.getInfo(taskId);
947947
assertNotNull(storedConfigs,
948948
"Push notification config should be stored for existing task");
949-
assertTrue(storedConfigs.size() >= 1,
950-
"Should have at least 1 push config stored");
949+
assertEquals(1, storedConfigs.size(),
950+
"Should have exactly 1 push config stored");
951951
assertEquals("config-existing-1", storedConfigs.get(0).id());
952952
assertEquals("https://example.com/existing-webhook", storedConfigs.get(0).url());
953953
}

0 commit comments

Comments
 (0)