From ffc109e406b25c1473b75c0bb11001f575b62160 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 25 Aug 2020 11:23:00 +0100 Subject: [PATCH] Fix bugs --- internal/caching/cache_roomservernids.go | 6 +++--- roomserver/storage/shared/storage.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/caching/cache_roomservernids.go b/internal/caching/cache_roomservernids.go index fdd7fadcc..79883ca72 100644 --- a/internal/caching/cache_roomservernids.go +++ b/internal/caching/cache_roomservernids.go @@ -47,7 +47,7 @@ func (c Caches) GetRoomServerStateKeyNID(stateKey string) (types.EventStateKeyNI } func (c Caches) StoreRoomServerStateKeyNID(stateKey string, nid types.EventStateKeyNID) { - c.RoomVersions.Set(stateKey, nid) + c.RoomServerStateKeyNIDs.Set(stateKey, nid) } func (c Caches) GetRoomServerEventTypeNID(eventType string) (types.EventTypeNID, bool) { @@ -61,7 +61,7 @@ func (c Caches) GetRoomServerEventTypeNID(eventType string) (types.EventTypeNID, } func (c Caches) StoreRoomServerEventTypeNID(eventType string, nid types.EventTypeNID) { - c.RoomVersions.Set(eventType, nid) + c.RoomServerEventTypeNIDs.Set(eventType, nid) } func (c Caches) GetRoomServerRoomNID(roomID string) (types.RoomNID, bool) { @@ -75,5 +75,5 @@ func (c Caches) GetRoomServerRoomNID(roomID string) (types.RoomNID, bool) { } func (c Caches) StoreRoomServerRoomNID(roomID string, nid types.RoomNID) { - c.RoomVersions.Set(roomID, nid) + c.RoomServerRoomNIDs.Set(roomID, nid) } diff --git a/roomserver/storage/shared/storage.go b/roomserver/storage/shared/storage.go index b7a530ffe..c0f214900 100644 --- a/roomserver/storage/shared/storage.go +++ b/roomserver/storage/shared/storage.go @@ -216,7 +216,6 @@ func (d *Database) RoomNIDExcludingStubs(ctx context.Context, roomID string) (ro if err != nil { return } - d.Cache.StoreRoomServerRoomNID(roomID, roomNID) } latestEvents, _, err := d.RoomsTable.SelectLatestEventNIDs(ctx, nil, roomNID) if err != nil {