feat(FN-3795): add WhatsApp dedupe retention pruning and reports plugin sca

Merges the reports plugin scaffold (FN-3778, FN-3790) with notification service improvements across the engine, plus mailbox UI enhancements; adds WhatsApp message deduplication retention pruning (FN-3795) with tests and documentation; introduces /tasks deep-link routing with theme-data URL resoluti

Fusion-Task-Id: FN-3795
This commit is contained in:
Fusion
2026-05-08 23:35:54 -07:00
committed by gsxdsm
parent 18413a1c42
commit de070db4a5
5 changed files with 135 additions and 6 deletions

View File

@@ -3,7 +3,17 @@ import type { PluginContext } from "@fusion/plugin-sdk";
import pino from "pino";
import qrcode from "qrcode";
import { clearAuthState, createPluginDbAuthState } from "./auth-state.js";
import { getAllowedSenders, getHistoryTurnLimit, loadHistory, markProcessed, saveHistory, wasProcessed, type ChatTurn, type PluginDb } from "./index.js";
import {
getAllowedSenders,
getDedupeRetentionDays,
getHistoryTurnLimit,
loadHistory,
markProcessed,
saveHistory,
wasProcessed,
type ChatTurn,
type PluginDb,
} from "./index.js";
export type ConnectionStatus = {
state: "starting" | "awaiting-qr" | "awaiting-code" | "connected" | "disconnected" | "error";
@@ -181,7 +191,7 @@ export class WhatsAppConnection {
if (allowedSenders.size === 0 || (!allowedSenders.has(sender) && !allowedSenders.has(jid))) continue;
if (wasProcessed(this.db, messageId)) continue;
markProcessed(this.db, messageId, sender);
markProcessed(this.db, messageId, sender, getDedupeRetentionDays(this.ctx.settings));
try {
const history = loadHistory(this.db, sender);