about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-08 23:45:26 +0200
committerRory& <root@rory.gay>2025-05-08 23:45:26 +0200
commitf8f1feff2bcbfb2bd5fdb498b2e8572ecba37b2c (patch)
tree7f0ded64c845e228573d0f251dceacbba6e4817a
parentRetry http requests up to 5 times, add support for unstable state_after (diff)
downloadLibMatrix-f8f1feff2bcbfb2bd5fdb498b2e8572ecba37b2c.tar.xz
Verbosity
-rw-r--r--LibMatrix/Helpers/SyncHelper.cs4
-rw-r--r--LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs6
2 files changed, 7 insertions, 3 deletions
diff --git a/LibMatrix/Helpers/SyncHelper.cs b/LibMatrix/Helpers/SyncHelper.cs

index 862c8ad..6488464 100644 --- a/LibMatrix/Helpers/SyncHelper.cs +++ b/LibMatrix/Helpers/SyncHelper.cs
@@ -25,6 +25,10 @@ public class SyncHelper(AuthenticatedHomeserverGeneric homeserver, ILogger? logg public string? Since { get; set; } public int Timeout { get; set; } = 30000; public string? SetPresence { get; set; } = "online"; + + /// <summary> + /// Disabling this uses a technically slower code path, useful for checking whether delay comes from waiting for server or deserialising responses + /// </summary> public bool UseInternalStreamingSync { get; set; } = true; public bool UseMsc4222StateAfter { diff --git a/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs b/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs
index f9f6ba3..9baeaa4 100644 --- a/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs +++ b/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs
@@ -29,11 +29,11 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese var modified = false; List<Task<bool>> tasks = []; if (resp.Rooms is { Join.Count: > 0 }) { - tasks.AddRange(resp.Rooms.Join.Select(ProcessJoinedRooms)); + tasks.AddRange(resp.Rooms.Join.Select(ProcessJoinedRooms).ToList()); } if (resp.Rooms is { Leave.Count: > 0 }) { - tasks.AddRange(resp.Rooms.Leave.Select(ProcessLeftRooms)); + tasks.AddRange(resp.Rooms.Leave.Select(ProcessLeftRooms).ToList()); } var tasksEnum = tasks.ToAsyncEnumerable(); @@ -43,7 +43,7 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese } } - Console.WriteLine($"Msc4222EmulationSyncProcessor.EmulateMsc4222 processed {resp.Rooms?.Join?.Count}/{resp.Rooms?.Leave?.Count} rooms in {sw.Elapsed}"); + Console.WriteLine($"Msc4222EmulationSyncProcessor.EmulateMsc4222 processed {resp.Rooms?.Join?.Count}/{resp.Rooms?.Leave?.Count} rooms in {sw.Elapsed} (modified: {modified})"); if (modified) resp.Msc4222Method = SyncResponse.Msc4222SyncType.Emulated;