mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-03 12:13:09 -06:00
Correct account data position mapping
This commit is contained in:
parent
e4dc90e368
commit
127bbceee1
|
|
@ -119,6 +119,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
||||||
var dataType string
|
var dataType string
|
||||||
var roomID string
|
var roomID string
|
||||||
var id types.StreamPosition
|
var id types.StreamPosition
|
||||||
|
var highest types.StreamPosition
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
||||||
|
|
@ -130,8 +131,8 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
||||||
} else {
|
} else {
|
||||||
data[roomID] = []string{dataType}
|
data[roomID] = []string{dataType}
|
||||||
}
|
}
|
||||||
if id > pos {
|
if id > highest {
|
||||||
pos = id
|
highest = id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if pos == 0 {
|
if pos == 0 {
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
||||||
var dataType string
|
var dataType string
|
||||||
var roomID string
|
var roomID string
|
||||||
var id types.StreamPosition
|
var id types.StreamPosition
|
||||||
|
var highest types.StreamPosition
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
||||||
|
|
@ -126,8 +127,8 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
||||||
} else {
|
} else {
|
||||||
data[roomID] = []string{dataType}
|
data[roomID] = []string{dataType}
|
||||||
}
|
}
|
||||||
if id > pos {
|
if id > highest {
|
||||||
pos = id
|
highest = id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if pos == 0 {
|
if pos == 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue