about summary refs log tree commit diff
path: root/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-05-03 17:12:35 +0200
committerRory& <root@rory.gay>2024-05-03 17:12:35 +0200
commit896ee7f099f817e8cc9aba96a9db00fcce671632 (patch)
tree5c4c97baab8afb1b66ee4ffcced7285ab2ee06a0 /Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs
parentHomeserverEmulator work (diff)
downloadLibMatrix-896ee7f099f817e8cc9aba96a9db00fcce671632.tar.xz
Fix some race conditions and some optimisation in HomeserverEmulator
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs')
-rw-r--r--Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs5
1 files changed, 4 insertions, 1 deletions
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<RoomStateController> 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;
     }