aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/postgres/account_data_table.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/storage/postgres/account_data_table.go')
-rw-r--r--syncapi/storage/postgres/account_data_table.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/syncapi/storage/postgres/account_data_table.go b/syncapi/storage/postgres/account_data_table.go
index 58fb2198..a5e0c121 100644
--- a/syncapi/storage/postgres/account_data_table.go
+++ b/syncapi/storage/postgres/account_data_table.go
@@ -100,19 +100,12 @@ func (s *accountDataStatements) InsertAccountData(
func (s *accountDataStatements) SelectAccountDataInRange(
ctx context.Context,
userID string,
- oldPos, newPos types.StreamPosition,
+ r types.Range,
accountDataEventFilter *gomatrixserverlib.EventFilter,
) (data map[string][]string, err error) {
data = make(map[string][]string)
- // If both positions are the same, it means that the data was saved after the
- // latest room event. In that case, we need to decrement the old position as
- // it would prevent the SQL request from returning anything.
- if oldPos == newPos {
- oldPos--
- }
-
- rows, err := s.selectAccountDataInRangeStmt.QueryContext(ctx, userID, oldPos, newPos,
+ rows, err := s.selectAccountDataInRangeStmt.QueryContext(ctx, userID, r.Low(), r.High(),
pq.StringArray(filterConvertTypeWildcardToSQL(accountDataEventFilter.Types)),
pq.StringArray(filterConvertTypeWildcardToSQL(accountDataEventFilter.NotTypes)),
accountDataEventFilter.Limit,