From 9d1a2d977a7505c3ad6f4ccc62cc3ac8ad76c46c Mon Sep 17 00:00:00 2001 From: Sanaz Taheri Boshrooyeh <35961250+staheri14@users.noreply.github.com> Date: Wed, 12 Jan 2022 11:10:59 -0800 Subject: [PATCH] Adds support for auto-pagination (#478) * clarifies auto-pagination * sem-break * applies comments --- content/docs/rfcs/13/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content/docs/rfcs/13/README.md b/content/docs/rfcs/13/README.md index 04c00a41..bc737172 100644 --- a/content/docs/rfcs/13/README.md +++ b/content/docs/rfcs/13/README.md @@ -128,7 +128,15 @@ RPC call to query historical messages. - The `contentFilters` field MUST indicate the list of content filters based on which the historical messages are to be retrieved. Leaving this field empty means no filter on the content topic of message history is required. This field SHOULD be left empty in order to retrieve historical waku messages regardless of their content topics. -- `PagingInfo` holds the information required for pagination. Its `pageSize` field indicates the number of `WakuMessage`s to be included in the corresponding `HistoryResponse`. If the `pageSize` is zero then no pagination is required. If the `pageSize` exceeds a threshold then the threshold value shall be used instead. In the forward pagination request, the `messages` field of the `HistoryResponse` shall contain at maximum the `pageSize` amount of waku messages whose `Index` values are larger than the given `cursor` (and vise versa for the backward pagination). Note that the `cursor` of a `HistoryQuery` may be empty (e.g., for the initial query), as such, and depending on whether the `direction` is `BACKWARD` or `FORWARD` the last or the first `pageSize` waku messages shall be returned, respectively. +- `PagingInfo` holds the information required for pagination. + Its `pageSize` field indicates the number of `WakuMessage`s to be included in the corresponding `HistoryResponse`. + It is RECOMMENDED that the queried node defines a maximum page size internally. + If the querying node leaves the `pageSize` unspecified, + or if the `pageSize` exceeds the maximum page size, + the queried node SHOULD auto-paginate the `HistoryResponse` to no more than the configured maximum page size. + This allows mitigation of long response time for `HistoryQuery`. + In the forward pagination request, the `messages` field of the `HistoryResponse` shall contain at maximum the `pageSize` amount of waku messages whose `Index` values are larger than the given `cursor` (and vise versa for the backward pagination). + Note that the `cursor` of a `HistoryQuery` may be empty (e.g., for the initial query), as such, and depending on whether the `direction` is `BACKWARD` or `FORWARD` the last or the first `pageSize` waku messages shall be returned, respectively. The queried node MUST sort the `WakuMessage`s based on their `Index`, where the `senderTime` constitutes the most significant part and the `digest` comes next, and then perform pagination on the sorted result. As such, the retrieved page contains an ordered list of `WakuMessage`s from the oldest message to the most recent one.