From 0cda3c52d0dc0462b204c8dc455762821bb74c3f Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 2 Mar 2020 17:47:39 +0000 Subject: [PATCH] Don't fail hard if backward topology position fails, just use 1 instead --- syncapi/storage/postgres/syncserver.go | 3 --- syncapi/storage/sqlite3/syncserver.go | 4 ---- 2 files changed, 7 deletions(-) diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go index 6a33a8b4f..abb5b4a4c 100644 --- a/syncapi/storage/postgres/syncserver.go +++ b/syncapi/storage/postgres/syncserver.go @@ -619,9 +619,6 @@ func (d *SyncServerDatasource) getResponseWithPDUsForCompleteSync( // oldest event in the room's topology. var backwardTopologyPos types.StreamPosition backwardTopologyPos, err = d.topology.selectPositionInTopology(ctx, recentStreamEvents[0].EventID()) - if err != nil { - return nil, types.PaginationToken{}, []string{}, err - } if backwardTopologyPos-1 <= 0 { backwardTopologyPos = types.StreamPosition(1) } else { diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go index 6ad3419c7..da580e3a2 100644 --- a/syncapi/storage/sqlite3/syncserver.go +++ b/syncapi/storage/sqlite3/syncserver.go @@ -657,10 +657,6 @@ func (d *SyncServerDatasource) getResponseWithPDUsForCompleteSync( // oldest event in the room's topology. var backwardTopologyPos types.StreamPosition backwardTopologyPos, err = d.topology.selectPositionInTopology(ctx, txn, recentStreamEvents[0].EventID()) - if err != nil { - return nil, types.PaginationToken{}, []string{}, err - } - if backwardTopologyPos-1 <= 0 { backwardTopologyPos = types.StreamPosition(1) } else {