diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go index a5e13b67..838fd547 100644 --- a/syncapi/storage/interface.go +++ b/syncapi/storage/interface.go @@ -104,8 +104,6 @@ type Database interface { // matches the streamevent.transactionID device then the transaction ID gets // added to the unsigned section of the output event. StreamEventsToEvents(device *userapi.Device, in []types.StreamEvent) []gomatrixserverlib.HeaderedEvent - // SyncStreamPosition returns the latest position in the sync stream. Returns 0 if there are no events yet. - SyncStreamPosition(ctx context.Context) (types.StreamPosition, error) // AddSendToDevice increases the EDU position in the cache and returns the stream position. AddSendToDevice() types.StreamPosition // SendToDeviceUpdatesForSync returns a list of send-to-device updates. It returns three lists: diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index 401bae33..37793ba2 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -133,35 +133,6 @@ func (d *Database) GetStateEventsForRoom( return } -func (d *Database) SyncStreamPosition(ctx context.Context) (types.StreamPosition, error) { - var maxID int64 - var err error - err = sqlutil.WithTransaction(d.DB, func(txn *sql.Tx) error { - maxID, err = d.OutputEvents.SelectMaxEventID(ctx, txn) - if err != nil { - return err - } - var maxAccountDataID int64 - maxAccountDataID, err = d.AccountData.SelectMaxAccountDataID(ctx, txn) - if err != nil { - return err - } - if maxAccountDataID > maxID { - maxID = maxAccountDataID - } - var maxInviteID int64 - maxInviteID, err = d.Invites.SelectMaxInviteID(ctx, txn) - if err != nil { - return err - } - if maxInviteID > maxID { - maxID = maxInviteID - } - return nil - }) - return types.StreamPosition(maxID), err -} - // AddInviteEvent stores a new invite event for a user. // If the invite was successfully stored this returns the stream ID it was stored at. // Returns an error if there was a problem communicating with the database.