From 7d9bf717066b25b1d9d49af346bca26039d62bfe Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 30 Sep 2022 12:33:26 +0100 Subject: [PATCH] Review comments --- syncapi/routing/messages.go | 3 +++ syncapi/storage/shared/{syncserver.go => storage_consumer.go} | 0 syncapi/storage/shared/{transaction.go => storage_sync.go} | 0 3 files changed, 3 insertions(+) rename syncapi/storage/shared/{syncserver.go => storage_consumer.go} (100%) rename syncapi/storage/shared/{transaction.go => storage_sync.go} (100%) diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go index 8442dea4d..8f3ed3f5b 100644 --- a/syncapi/routing/messages.go +++ b/syncapi/routing/messages.go @@ -72,6 +72,9 @@ func OnIncomingMessagesRequest( ) util.JSONResponse { var err error + // NewDatabaseTransaction is used here instead of NewDatabaseSnapshot as we + // expect to be able to write to the database in response to a /messages + // request that requires backfilling from the roomserver or federation. snapshot, err := db.NewDatabaseTransaction(req.Context()) if err != nil { return jsonerror.InternalServerError() diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/storage_consumer.go similarity index 100% rename from syncapi/storage/shared/syncserver.go rename to syncapi/storage/shared/storage_consumer.go diff --git a/syncapi/storage/shared/transaction.go b/syncapi/storage/shared/storage_sync.go similarity index 100% rename from syncapi/storage/shared/transaction.go rename to syncapi/storage/shared/storage_sync.go