From 896ee7f099f817e8cc9aba96a9db00fcce671632 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 3 May 2024 17:12:35 +0200 Subject: Fix some race conditions and some optimisation in HomeserverEmulator --- .../Controllers/Rooms/RoomStateController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers') diff --git a/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs b/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs index a1738c9..74c70a3 100644 --- a/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs +++ b/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs @@ -64,11 +64,14 @@ public class RoomStateController(ILogger logger, TokenServi }; var stateEvent = room.State.FirstOrDefault(x => x.Type == eventType && x.StateKey == stateKey); - if (stateEvent == null) + if (stateEvent == null) { + Console.WriteLine($"Event not found in room {roomId} matching {eventType}/{stateKey}"); throw new MatrixException() { ErrorCode = "M_NOT_FOUND", Error = "Event not found" }; + } + // return stateEvent; return format == "event" ? stateEvent : stateEvent.RawContent; } -- cgit 1.4.1