From d836dba98240e64014a1b0773a007328137d0706 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Oct 2024 14:18:34 +0900 Subject: [PATCH] Rename and xmldoc `RealmResetEmptySet` --- osu.Game/Database/DetachedBeatmapStore.cs | 2 +- osu.Game/Database/RealmAccess.cs | 2 +- .../Database/{EmptyRealmSet.cs => RealmResetEmptySet.cs} | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) rename osu.Game/Database/{EmptyRealmSet.cs => RealmResetEmptySet.cs} (82%) diff --git a/osu.Game/Database/DetachedBeatmapStore.cs b/osu.Game/Database/DetachedBeatmapStore.cs index f5c975d9db..5b65f608b2 100644 --- a/osu.Game/Database/DetachedBeatmapStore.cs +++ b/osu.Game/Database/DetachedBeatmapStore.cs @@ -44,7 +44,7 @@ namespace osu.Game.Database { if (changes == null) { - if (sender is EmptyRealmSet) + if (sender is RealmResetEmptySet) { // Usually we'd reset stuff here, but doing so triggers a silly flow which ends up deadlocking realm. // Additionally, user should not be at song select when realm is blocking all operations in the first place. diff --git a/osu.Game/Database/RealmAccess.cs b/osu.Game/Database/RealmAccess.cs index cb91d6923b..ad0423191d 100644 --- a/osu.Game/Database/RealmAccess.cs +++ b/osu.Game/Database/RealmAccess.cs @@ -568,7 +568,7 @@ namespace osu.Game.Database lock (notificationsResetMap) { // Store an action which is used when blocking to ensure consumers don't use results of a stale changeset firing. - notificationsResetMap.Add(action, () => callback(new EmptyRealmSet(), null)); + notificationsResetMap.Add(action, () => callback(new RealmResetEmptySet(), null)); } return RegisterCustomSubscription(action); diff --git a/osu.Game/Database/EmptyRealmSet.cs b/osu.Game/Database/RealmResetEmptySet.cs similarity index 82% rename from osu.Game/Database/EmptyRealmSet.cs rename to osu.Game/Database/RealmResetEmptySet.cs index c34974cb03..9f9a1ba6d7 100644 --- a/osu.Game/Database/EmptyRealmSet.cs +++ b/osu.Game/Database/RealmResetEmptySet.cs @@ -12,7 +12,13 @@ using Realms.Schema; namespace osu.Game.Database { - public class EmptyRealmSet : IRealmCollection + /// + /// This can arrive in callbacks to imply that realm access has been reset. + /// + /// + /// Usually implies that the original database may return soon and the callback can usually be silently ignored. + /// + public class RealmResetEmptySet : IRealmCollection { private IList emptySet => Array.Empty();