aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/tables/interface.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-03-18 10:40:01 +0000
committerGitHub <noreply@github.com>2022-03-18 10:40:01 +0000
commit475d3c1af96c663ecc25859d654fad6063e70b8a (patch)
tree767f75372473f32ab1e4d95bff0cde7ea77cb968 /syncapi/storage/tables/interface.go
parent191486438cc0d2999dc93878901f7d7d4cae4293 (diff)
Better mapping of stream positions to topological positions in `/messages` (#2263)
* Convert stream positions into topological positions for both `from` and `to` in `/messages` * Hopefully it works now * Remove unnecessary logging * Return sane values if `StreamToTopologicalPosition` can't work out the right thing to do * Revert logging change * tweaks * Fix `selectEventIDsInRangeASCSQL` * Test `Getting messages going forward is limited for a departed room (SPEC-216)` was passing incorrectly so un-whitelist it
Diffstat (limited to 'syncapi/storage/tables/interface.go')
-rw-r--r--syncapi/storage/tables/interface.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/syncapi/storage/tables/interface.go b/syncapi/storage/tables/interface.go
index 9d1078f5..640b7dc3 100644
--- a/syncapi/storage/tables/interface.go
+++ b/syncapi/storage/tables/interface.go
@@ -87,6 +87,8 @@ type Topology interface {
SelectMaxPositionInTopology(ctx context.Context, txn *sql.Tx, roomID string) (depth types.StreamPosition, spos types.StreamPosition, err error)
// DeleteTopologyForRoom removes all topological information for a room. This should only be done when removing the room entirely.
DeleteTopologyForRoom(ctx context.Context, txn *sql.Tx, roomID string) (err error)
+ // SelectStreamToTopologicalPosition converts a stream position to a topological position by finding the nearest topological position in the room.
+ SelectStreamToTopologicalPosition(ctx context.Context, txn *sql.Tx, roomID string, streamPos types.StreamPosition, forward bool) (topoPos types.StreamPosition, err error)
}
type CurrentRoomState interface {