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();
|
const first = await fixture.selfHeal.runBoardStallAutoRecoverySweep();
|
||||||
expect(first.recovered).toBeGreaterThanOrEqual(0);
|
expect(first.recovered).toBeGreaterThanOrEqual(0);
|
||||||
|
|
||||||
|
(fixture.manager as any).maintenanceTickCounter++;
|
||||||
const second = await fixture.selfHeal.runBoardStallAutoRecoverySweep();
|
const second = await fixture.selfHeal.runBoardStallAutoRecoverySweep();
|
||||||
expect(typeof second.unrecovered).toBe("boolean");
|
expect(typeof second.unrecovered).toBe("boolean");
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -2584,15 +2584,23 @@ export class SelfHealingManager {
|
|||||||
let ntfyDispatched = false;
|
let ntfyDispatched = false;
|
||||||
if (ntfyAllowed) {
|
if (ntfyAllowed) {
|
||||||
try {
|
try {
|
||||||
await getActiveNotificationService()?.dispatch("board-stall-unrecovered", {
|
const settings = await this.store.getSettings();
|
||||||
event: "board-stall-unrecovered",
|
const enabled = Boolean(settings.ntfyEnabled && settings.ntfyTopic);
|
||||||
metadata: {
|
const events = resolveNtfyEvents(settings.ntfyEvents);
|
||||||
holderIds: window.pendingVerification.holderIds,
|
if (enabled && isNtfyEventEnabled(events, "board-stall-unrecovered")) {
|
||||||
followerCount: window.pendingVerification.followerCount,
|
const clickUrl = buildNtfyClickUrl({ dashboardHost: settings.ntfyDashboardHost });
|
||||||
},
|
await sendNtfyNotification({
|
||||||
} as any);
|
ntfyBaseUrl: settings.ntfyBaseUrl,
|
||||||
window.lastNtfyAt = now;
|
ntfyAccessToken: settings.ntfyAccessToken,
|
||||||
ntfyDispatched = true;
|
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 {
|
} catch {
|
||||||
ntfyDispatched = false;
|
ntfyDispatched = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user