fix(FN-4890): refine board-stall notification path
Fusion-Task-Id: FN-4890 Fusion-Task-Lineage: d1ae6585-7df0-481f-83c3-c7cdd45daf4f
This commit is contained in:
committed by
gsxdsm
parent
70aa8b31b7
commit
4d10511418
@@ -23,6 +23,7 @@ describe("reliability interactions: board stall auto-recovery", () => {
|
||||
const first = await fixture.selfHeal.runBoardStallAutoRecoverySweep();
|
||||
expect(first.recovered).toBeGreaterThanOrEqual(0);
|
||||
|
||||
(fixture.manager as any).maintenanceTickCounter++;
|
||||
const second = await fixture.selfHeal.runBoardStallAutoRecoverySweep();
|
||||
expect(typeof second.unrecovered).toBe("boolean");
|
||||
} finally {
|
||||
|
||||
@@ -2584,15 +2584,23 @@ export class SelfHealingManager {
|
||||
let ntfyDispatched = false;
|
||||
if (ntfyAllowed) {
|
||||
try {
|
||||
await getActiveNotificationService()?.dispatch("board-stall-unrecovered", {
|
||||
event: "board-stall-unrecovered",
|
||||
metadata: {
|
||||
holderIds: window.pendingVerification.holderIds,
|
||||
followerCount: window.pendingVerification.followerCount,
|
||||
},
|
||||
} as any);
|
||||
window.lastNtfyAt = now;
|
||||
ntfyDispatched = true;
|
||||
const settings = await this.store.getSettings();
|
||||
const enabled = Boolean(settings.ntfyEnabled && settings.ntfyTopic);
|
||||
const events = resolveNtfyEvents(settings.ntfyEvents);
|
||||
if (enabled && isNtfyEventEnabled(events, "board-stall-unrecovered")) {
|
||||
const clickUrl = buildNtfyClickUrl({ dashboardHost: settings.ntfyDashboardHost });
|
||||
await sendNtfyNotification({
|
||||
ntfyBaseUrl: settings.ntfyBaseUrl,
|
||||
ntfyAccessToken: settings.ntfyAccessToken,
|
||||
topic: settings.ntfyTopic!,
|
||||
title: "Board stall unrecovered",
|
||||
message: `Auto-recovery could not clear board stall. Holders: ${window.pendingVerification.holderIds.join(", ") || "none"}. Followers blocked: ${window.pendingVerification.followerCount}.`,
|
||||
priority: "high",
|
||||
clickUrl,
|
||||
});
|
||||
window.lastNtfyAt = now;
|
||||
ntfyDispatched = true;
|
||||
}
|
||||
} catch {
|
||||
ntfyDispatched = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user