Skip to content

Commit a2daec9

Browse files
authored
fix: InMemoryPushNotificationConfigStore uses wrong pagination token. (#555)
* Using the 'id' field instead of the 'token' field as the pagination token. Fixes #554
1 parent 6038ee2 commit a2daec9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server-common/src/main/java/io/a2a/server/tasks/InMemoryPushNotificationConfigStore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ public ListTaskPushNotificationConfigResult getInfo(ListTaskPushNotificationConf
7070
if (configs.size() <= params.pageSize()) {
7171
return new ListTaskPushNotificationConfigResult(convertPushNotificationConfig(configs, params), null);
7272
}
73-
String newToken = configs.get(params.pageSize()).token();
73+
String newToken = configs.get(params.pageSize()).id();
7474
return new ListTaskPushNotificationConfigResult(convertPushNotificationConfig(configs.subList(0, params.pageSize()), params), newToken);
7575
}
7676

77-
private int findFirstIndex(List<PushNotificationConfig> configs, String token) {
77+
private int findFirstIndex(List<PushNotificationConfig> configs, String id) {
7878
//find first index
7979
Iterator<PushNotificationConfig> iter = configs.iterator();
8080
int index = 0;
8181
while (iter.hasNext()) {
82-
if (token.equals(iter.next().token())) {
82+
if (id.equals(iter.next().id())) {
8383
return index;
8484
}
8585
index++;

0 commit comments

Comments
 (0)