From 8fa3e25eed226d9b81e1058e900fed89cdbed05f Mon Sep 17 00:00:00 2001 From: Artur Pata Date: Wed, 11 Sep 2024 19:14:49 +0300 Subject: [PATCH] Offset-based pagination duplicates if continuous event stream and query period includes the present moment --- .../controllers/api/external_stats_controller/query_test.exs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/plausible_web/controllers/api/external_stats_controller/query_test.exs b/test/plausible_web/controllers/api/external_stats_controller/query_test.exs index 1e89210d6b..5a5191edff 100644 --- a/test/plausible_web/controllers/api/external_stats_controller/query_test.exs +++ b/test/plausible_web/controllers/api/external_stats_controller/query_test.exs @@ -3328,6 +3328,10 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do assert json_response(conn1, 200)["meta"]["total_rows"] == 8 + populate_stats(site, [ + build(:pageview, pathname: "/0") + ]) + conn2 = post(conn, "/api/v2/query", Map.put(query, "pagination", %{"limit" => 3, "offset" => 3}))