From 7d556decdef803a84d1acb905c414bff7d5856b7 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:01:43 +0100 Subject: [PATCH] Default to 10 state events --- syncapi/routing/context.go | 3 ++- syncapi/syncapi_test.go | 2 +- syncapi/synctypes/filter.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/syncapi/routing/context.go b/syncapi/routing/context.go index eb4bd1cc0..7f256fd7f 100644 --- a/syncapi/routing/context.go +++ b/syncapi/routing/context.go @@ -109,7 +109,8 @@ func Context( } } - stateFilter := synctypes.StateFilter{ + stateFilter := synctypes.DefaultStateFilter() + stateFilter = synctypes.StateFilter{ NotSenders: filter.NotSenders, NotTypes: filter.NotTypes, Senders: filter.Senders, diff --git a/syncapi/syncapi_test.go b/syncapi/syncapi_test.go index 0a2c38ab7..0392f209a 100644 --- a/syncapi/syncapi_test.go +++ b/syncapi/syncapi_test.go @@ -1136,7 +1136,7 @@ func testContext(t *testing.T, dbType test.DBType) { }, { name: "events are not limited", - wantBeforeLength: 7, + wantBeforeLength: 5, }, { name: "all events are limited", diff --git a/syncapi/synctypes/filter.go b/syncapi/synctypes/filter.go index 8998d4433..f3cda15b8 100644 --- a/syncapi/synctypes/filter.go +++ b/syncapi/synctypes/filter.go @@ -128,6 +128,7 @@ func DefaultEventFilter() EventFilter { // is provided in the request func DefaultStateFilter() StateFilter { return StateFilter{ + Limit: 10, NotSenders: nil, NotTypes: nil, Senders: nil,