fix: dedup fund_capture alerts for same-date sibling records and add clear-all
fund_capture alerts for a symbol with multiple capture records sharing one as_of re-fired every batch cycle: the single comparison-state slot ping-ponged between sibling evidence URLs, and the pre-check dedup key never matched the stored buildDedupKey format. Track a seen-set of URLs in comparison state and align dedup-key construction with buildDedupKey. Also add alerts.clearAll (hard delete) with an immediate-refresh bell.
This commit is contained in:
@@ -2085,6 +2085,14 @@ const alertsRouter = router({
|
||||
return { ok: true };
|
||||
}),
|
||||
|
||||
/** Permanently delete all alert events for the current user. */
|
||||
clearAll: protectedProcedure
|
||||
.mutation(async ({ ctx }) => {
|
||||
const userId = ctx.userId as string;
|
||||
ctx.db.prepare('DELETE FROM alert_events WHERE user_id = ?').run(userId);
|
||||
return { ok: true };
|
||||
}),
|
||||
|
||||
/** Get unacknowledged alert count. */
|
||||
unackedCount: protectedProcedure
|
||||
.query(async ({ ctx }) => {
|
||||
|
||||
Reference in New Issue
Block a user