aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-04-26 16:07:13 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-04-26 16:08:01 +0100
commitf6d07768a82cdea07c56cf4ae463449292fa9fe4 (patch)
tree2944d70d1e0a663184c294a04cd1b66ffc5034f9 /syncapi/storage
parent6892e0f0e02466be3cac6fc6f17267aeecb5961b (diff)
Fix account data position
Diffstat (limited to 'syncapi/storage')
-rw-r--r--syncapi/storage/postgres/account_data_table.go3
-rw-r--r--syncapi/storage/sqlite3/account_data_table.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/syncapi/storage/postgres/account_data_table.go b/syncapi/storage/postgres/account_data_table.go
index 0a714691..ec1919fc 100644
--- a/syncapi/storage/postgres/account_data_table.go
+++ b/syncapi/storage/postgres/account_data_table.go
@@ -105,6 +105,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
accountDataEventFilter *gomatrixserverlib.EventFilter,
) (data map[string][]string, pos types.StreamPosition, err error) {
data = make(map[string][]string)
+ pos = r.Low()
rows, err := s.selectAccountDataInRangeStmt.QueryContext(ctx, userID, r.Low(), r.High(),
pq.StringArray(filterConvertTypeWildcardToSQL(accountDataEventFilter.Types)),
@@ -118,7 +119,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
var dataType string
var roomID string
- id := r.From
+ var id types.StreamPosition
for rows.Next() {
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
diff --git a/syncapi/storage/sqlite3/account_data_table.go b/syncapi/storage/sqlite3/account_data_table.go
index d84159ac..2c7272ea 100644
--- a/syncapi/storage/sqlite3/account_data_table.go
+++ b/syncapi/storage/sqlite3/account_data_table.go
@@ -96,6 +96,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
r types.Range,
filter *gomatrixserverlib.EventFilter,
) (data map[string][]string, pos types.StreamPosition, err error) {
+ pos = r.Low()
data = make(map[string][]string)
stmt, params, err := prepareWithFilters(
s.db, nil, selectAccountDataInRangeSQL,
@@ -114,7 +115,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
var dataType string
var roomID string
- id := r.From
+ var id types.StreamPosition
for rows.Next() {
if err = rows.Scan(&id, &roomID, &dataType); err != nil {