aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/interface.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-07-13 14:18:37 +0200
committerGitHub <noreply@github.com>2023-07-13 14:18:37 +0200
commitf12982472c71b8daf3de682c2807989ee695d2cf (patch)
tree16dce5247f0b7cc2c9416b68edf3bfd212079d87 /syncapi/storage/interface.go
parent0df982a2e50021183fa478d99b2e463d512ff230 (diff)
Tweaks around `/messages` (#3149)
Try to mitigate some issues with `/messages`
Diffstat (limited to 'syncapi/storage/interface.go')
-rw-r--r--syncapi/storage/interface.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go
index 243b2592..dca5d1a1 100644
--- a/syncapi/storage/interface.go
+++ b/syncapi/storage/interface.go
@@ -81,8 +81,11 @@ type DatabaseTransaction interface {
// If no data is retrieved, returns an empty map
// If there was an issue with the retrieval, returns an error
GetAccountDataInRange(ctx context.Context, userID string, r types.Range, accountDataFilterPart *synctypes.EventFilter) (map[string][]string, types.StreamPosition, error)
- // GetEventsInTopologicalRange retrieves all of the events on a given ordering using the given extremities and limit. If backwardsOrdering is true, the most recent event must be first, else last.
- GetEventsInTopologicalRange(ctx context.Context, from, to *types.TopologyToken, roomID string, filter *synctypes.RoomEventFilter, backwardOrdering bool) (events []types.StreamEvent, err error)
+ // GetEventsInTopologicalRange retrieves all of the events on a given ordering using the given extremities and limit.
+ // If backwardsOrdering is true, the most recent event must be first, else last.
+ // Returns the filtered StreamEvents on success. Returns **unfiltered** StreamEvents and ErrNoEventsForFilter if
+ // the provided filter removed all events, this can be used to still calculate the start/end position. (e.g for `/messages`)
+ GetEventsInTopologicalRange(ctx context.Context, from, to *types.TopologyToken, roomID string, filter *synctypes.RoomEventFilter, backwardOrdering bool) (events []types.StreamEvent, start, end types.TopologyToken, err error)
// EventPositionInTopology returns the depth and stream position of the given event.
EventPositionInTopology(ctx context.Context, eventID string) (types.TopologyToken, error)
// BackwardExtremitiesForRoom returns a map of backwards extremity event ID to a list of its prev_events.