Skip to content

Commit d74117a

Browse files
committed
chore: adds debug logging to notification dispatch
1 parent 61dbea3 commit d74117a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/app/lib/notifications.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function detectNewItems(current: DashboardData): NewItems {
4747
for (const item of current.pullRequests) seenPrIds.add(item.id);
4848
for (const item of current.workflowRuns) seenRunIds.add(item.id);
4949
initialized = true;
50+
console.debug(`[notifications] seeded: ${seenIssueIds.size} issues, ${seenPrIds.size} PRs, ${seenRunIds.size} runs`);
5051
return { issues: [], pullRequests: [], workflowRuns: [] };
5152
}
5253

@@ -71,6 +72,7 @@ export function detectNewItems(current: DashboardData): NewItems {
7172
}
7273
}
7374

75+
console.debug(`[notifications] detected: ${newIssues.length} new issues, ${newPrs.length} new PRs, ${newRuns.length} new runs (seen: ${seenIssueIds.size}/${seenPrIds.size}/${seenRunIds.size})`);
7476
return { issues: newIssues, pullRequests: newPrs, workflowRuns: newRuns };
7577
}
7678

@@ -106,7 +108,15 @@ function fireNotification(
106108
}
107109

108110
export function dispatchNotifications(newItems: NewItems, config: Config): void {
109-
if (!canNotify(config)) return;
111+
if (!canNotify(config)) {
112+
console.debug("[notifications] dispatch skipped — canNotify=false", {
113+
notificationApi: "Notification" in window,
114+
permission: "Notification" in window ? Notification.permission : "N/A",
115+
enabled: config.notifications.enabled,
116+
});
117+
return;
118+
}
119+
console.debug("[notifications] dispatching", { issues: newItems.issues.length, prs: newItems.pullRequests.length, runs: newItems.workflowRuns.length });
110120

111121
const { issues, pullRequests, workflowRuns } = newItems;
112122
const notifCfg = config.notifications;

0 commit comments

Comments
 (0)