From c35df15bdd75c7830b15c7b175d7575920ed71fa Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 14 Mar 2023 12:01:33 +0000 Subject: [PATCH 1/3] Spec implicit filter event limit Signed-off-by: Stuart Mumford --- data/api/client-server/definitions/event_filter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/api/client-server/definitions/event_filter.yaml b/data/api/client-server/definitions/event_filter.yaml index b68886931..dc3595f18 100644 --- a/data/api/client-server/definitions/event_filter.yaml +++ b/data/api/client-server/definitions/event_filter.yaml @@ -14,7 +14,7 @@ title: EventFilter properties: limit: - description: The maximum number of events to return. + description: The maximum number of events to return. If not specified defaults to 10. type: integer not_senders: description: A list of sender IDs to exclude. If this list is absent then no senders From 34a5ad8d70d2eb16aeeb3135811e2d69ba277a42 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 14 Mar 2023 19:32:00 +0000 Subject: [PATCH 2/3] Don't spec a specific number for the limit Signed-off-by: Stuart Mumford --- data/api/client-server/definitions/event_filter.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/api/client-server/definitions/event_filter.yaml b/data/api/client-server/definitions/event_filter.yaml index dc3595f18..d03c85daf 100644 --- a/data/api/client-server/definitions/event_filter.yaml +++ b/data/api/client-server/definitions/event_filter.yaml @@ -14,7 +14,11 @@ title: EventFilter properties: limit: - description: The maximum number of events to return. If not specified defaults to 10. + description: | + The maximum number of events to return, must be an integer greater than 0. + + Servers should apply a default value, and impose a maximum value to avoid + resource exhaustion. type: integer not_senders: description: A list of sender IDs to exclude. If this list is absent then no senders From acba8e96feb533bff67b9e63ad2345dfebd32397 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 14 Mar 2023 19:34:24 +0000 Subject: [PATCH 3/3] Add a changelog Signed-off-by: Stuart Mumford --- changelogs/client_server/newsfragments/1463.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/1463.clarification diff --git a/changelogs/client_server/newsfragments/1463.clarification b/changelogs/client_server/newsfragments/1463.clarification new file mode 100644 index 000000000..1cf431ee3 --- /dev/null +++ b/changelogs/client_server/newsfragments/1463.clarification @@ -0,0 +1 @@ +Clarify that servers should enforce a default `limit` on a filter if one is not specified.