diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-12-11 14:02:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-11 14:02:17 +0000 |
commit | ebcacd1bb56d6e37ff743c0430bc91e24d440199 (patch) | |
tree | d9cd72accebe4004e8eb067026ab0158ccff0a1a /syncapi/storage/shared/syncserver.go | |
parent | c55361c1b88b272c9a06e7dbc61f60e3effbd063 (diff) |
Give receipts their own stream ID in the database (#1631)
* Give read recipts their own database sequence
* Give receipts their own stream ID
* Change migration names
* Reset sequences
* Add max receipt queries, missing stream_id table entry for SQLite
Diffstat (limited to 'syncapi/storage/shared/syncserver.go')
-rw-r--r-- | syncapi/storage/shared/syncserver.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index c0ae3d7a..71a42003 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -483,10 +483,15 @@ func (d *Database) syncPositionTx( if maxPeekID > maxEventID { maxEventID = maxPeekID } + maxReceiptID, err := d.Receipts.SelectMaxReceiptID(ctx, txn) + if err != nil { + return sp, err + } // TODO: complete these positions sp = types.StreamingToken{ - PDUPosition: types.StreamPosition(maxEventID), - TypingPosition: types.StreamPosition(d.EDUCache.GetLatestSyncPosition()), + PDUPosition: types.StreamPosition(maxEventID), + TypingPosition: types.StreamPosition(d.EDUCache.GetLatestSyncPosition()), + ReceiptPosition: types.StreamPosition(maxReceiptID), } return } |