about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-04-19 19:50:08 +0200
committerRory& <root@rory.gay>2025-04-19 19:50:08 +0200
commit4b508fa6216c6682925a42b67936b068e6db8e64 (patch)
treeb219c53d36dac94c7078078cd7896efc224f64de
parentAdd room state synapse admin api, get homeserver as user on synapse (diff)
downloadLibMatrix-4b508fa6216c6682925a42b67936b068e6db8e64.tar.xz
Update ArcaneLibs for Blazor a11y, return empty cache if not found in NamedCache
Diffstat (limited to '')
m---------ArcaneLibs0
-rw-r--r--LibMatrix/Homeservers/Extensions/NamedCaches/NamedCache.cs11
2 files changed, 9 insertions, 2 deletions
diff --git a/ArcaneLibs b/ArcaneLibs
-Subproject d271210163fe7da268e026e434d3d18b5a63ea9
+Subproject 98913a604fa40d1d850d9ef5666823a64244ba5
diff --git a/LibMatrix/Homeservers/Extensions/NamedCaches/NamedCache.cs b/LibMatrix/Homeservers/Extensions/NamedCaches/NamedCache.cs

index 9f11fa0..1f62637 100644 --- a/LibMatrix/Homeservers/Extensions/NamedCaches/NamedCache.cs +++ b/LibMatrix/Homeservers/Extensions/NamedCaches/NamedCache.cs
@@ -13,7 +13,14 @@ public class NamedCache<T>(AuthenticatedHomeserverGeneric hs, string name) where /// </summary> /// <returns>The updated data</returns> public async Task<Dictionary<string, T>> ReadCacheMapAsync() { - _cache = await hs.GetAccountDataAsync<Dictionary<string, T>>(name); + try { + _cache = await hs.GetAccountDataAsync<Dictionary<string, T>>(name); + } + catch (MatrixException e) { + if (e is { ErrorCode: MatrixException.ErrorCodes.M_NOT_FOUND }) + _cache = []; + else throw; + } return _cache ?? new(); } @@ -54,7 +61,7 @@ public class NamedCache<T>(AuthenticatedHomeserverGeneric hs, string name) where var removedValue = cache[key]; cache.Remove(key); await hs.SetAccountDataAsync(name, cache); - + if (!unsafeUseCache) _lock.Release();