From 960ca9b67915408f26b825886f2b6c6481a658dc Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 8 Feb 2026 13:07:16 +0000 Subject: fix: treat bookmark not found as a no-op in rule engine instead of a failure (#2464) When a bookmark is deleted before the rule engine worker processes its event, the worker would throw an error, triggering failure metrics, error logging, and retries. This changes both the worker and RuleEngine.forBookmark to gracefully skip processing with an info log instead. Co-authored-by: Claude --- packages/trpc/lib/ruleEngine.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages/trpc/lib/ruleEngine.ts') diff --git a/packages/trpc/lib/ruleEngine.ts b/packages/trpc/lib/ruleEngine.ts index 233a6acf..acfd747e 100644 --- a/packages/trpc/lib/ruleEngine.ts +++ b/packages/trpc/lib/ruleEngine.ts @@ -72,13 +72,16 @@ export class RuleEngine { ); } - static async forBookmark(ctx: AuthedContext, bookmarkId: string) { + static async forBookmark( + ctx: AuthedContext, + bookmarkId: string, + ): Promise { const [bookmark, rules] = await Promise.all([ fetchBookmark(ctx.db, bookmarkId), RuleEngineRuleModel.getAll(ctx), ]); if (!bookmark) { - throw new Error(`Bookmark ${bookmarkId} not found`); + return null; } return new RuleEngine( ctx, -- cgit v1.2.3-70-g09d2