Move RunRetentionSweepIfDue to Phase 2 (depends on MessageManager.Store)
Smoke test in Task 6 surfaced a NullReferenceException at Plugin.cs:885 — the retention sweep was scheduled in Phase 1 but dereferences MessageManager.Store, which is only allocated in Phase 2 (LoadAsync). Move the call after MessageManager init. Drop the comment that wrongly claimed independence from Phase-2 services.
This commit is contained in:
@@ -471,12 +471,6 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
|||||||
Interface.UiBuilder.DisableCutsceneUiHide = true;
|
Interface.UiBuilder.DisableCutsceneUiHide = true;
|
||||||
Interface.UiBuilder.DisableGposeUiHide = true;
|
Interface.UiBuilder.DisableGposeUiHide = true;
|
||||||
|
|
||||||
// Hellion Chat — daily retention sweep, off-thread so it never
|
|
||||||
// blocks plugin load. Skips itself when disabled or already ran
|
|
||||||
// within the past 24 hours. Pure fire-and-forget on a background
|
|
||||||
// thread, so it doesn't depend on Phase-2 services being live.
|
|
||||||
RunRetentionSweepIfDue();
|
|
||||||
|
|
||||||
if (Config.ShowEmotes)
|
if (Config.ShowEmotes)
|
||||||
_ = EmoteCache.LoadData(); // Fire-and-forget intentional, exceptions are caught inside
|
_ = EmoteCache.LoadData(); // Fire-and-forget intentional, exceptions are caught inside
|
||||||
}
|
}
|
||||||
@@ -518,6 +512,11 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
|||||||
|
|
||||||
MessageManager = new MessageManager(this);
|
MessageManager = new MessageManager(this);
|
||||||
|
|
||||||
|
// Daily retention sweep, fire-and-forget. Lives in Phase 2 because
|
||||||
|
// it dereferences MessageManager.Store. Skips itself when disabled
|
||||||
|
// or when it already ran within the past 24 hours.
|
||||||
|
RunRetentionSweepIfDue();
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs service. Subscribes to the
|
// Hellion Chat — Auto-Tell-Tabs service. Subscribes to the
|
||||||
// MessageManager's MessageProcessed event for live tells and
|
// MessageManager's MessageProcessed event for live tells and
|
||||||
// to ClientState.Logout for the cleanup pass. Created after
|
// to ClientState.Logout for the cleanup pass. Created after
|
||||||
|
|||||||
Reference in New Issue
Block a user