Bug: Zoho duplicate-lead handler has broken async error handling #56
Labels
No Label
P0 Critical
P1 High
P2 Medium
P3 Low
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
performance
phase-7
phase-8
security
seo
ui
ux
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#56
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
server/index.js, the duplicate-lead catch block (around line 428) callsforwardToZoho(sanitized)inside atry/catch, butforwardToZohois an async function. Thetry/catchwill not catch async rejections — they'll become unhandled promise rejections instead.Additionally,
forwardToZohois called withoutawaitin the happy path (line ~416), which is the intended fire-and-forget pattern. But the duplicate-lead branch wraps it intry/catchas if it were synchronous, creating a false sense of error handling.Code
Fix
try/catchwrapper in the duplicate-lead branch.catch()handlers to bothforwardToZohocalls to prevent unhandled rejections:Severity
Low — Zoho forwarding is currently disabled (
ZOHO_ENABLEDdefaults tofalse), so this doesn't affect production. But it should be fixed before Zoho is enabled.