Correct account data position mapping

This commit is contained in:
Neil Alexander 2022-04-27 15:30:52 +01:00
parent e4dc90e368
commit 127bbceee1
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 6 additions and 4 deletions

View file

@ -119,6 +119,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
var dataType string
var roomID string
var id types.StreamPosition
var highest types.StreamPosition
for rows.Next() {
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
@ -130,8 +131,8 @@ func (s *accountDataStatements) SelectAccountDataInRange(
} else {
data[roomID] = []string{dataType}
}
if id > pos {
pos = id
if id > highest {
highest = id
}
}
if pos == 0 {

View file

@ -115,6 +115,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
var dataType string
var roomID string
var id types.StreamPosition
var highest types.StreamPosition
for rows.Next() {
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
@ -126,8 +127,8 @@ func (s *accountDataStatements) SelectAccountDataInRange(
} else {
data[roomID] = []string{dataType}
}
if id > pos {
pos = id
if id > highest {
highest = id
}
}
if pos == 0 {