This commit is contained in:
Till Faelligen 2025-05-17 19:23:52 +02:00
parent f0578a506d
commit 4ee2ef0c6d
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E
2 changed files with 5 additions and 2 deletions

View file

@ -92,6 +92,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
accountDataEventFilter *synctypes.EventFilter,
) (data map[string][]string, pos types.StreamPosition, err error) {
data = make(map[string][]string)
pos = r.Low()
rows, err := sqlutil.TxStmt(txn, s.selectAccountDataInRangeStmt).QueryContext(
ctx, userID, r.Low(), r.High(),
@ -122,7 +123,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
pos = id
}
}
if pos == 0 {
if len(data) == 0 {
pos = r.High()
}
return data, pos, rows.Err()

View file

@ -84,6 +84,8 @@ func (s *accountDataStatements) SelectAccountDataInRange(
filter *synctypes.EventFilter,
) (data map[string][]string, pos types.StreamPosition, err error) {
data = make(map[string][]string)
pos = r.Low()
stmt, params, err := prepareWithFilters(
s.db, txn, selectAccountDataInRangeSQL,
[]interface{}{
@ -119,7 +121,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
pos = id
}
}
if pos == 0 {
if len(data) == 0 {
pos = r.High()
}
return data, pos, rows.Err()