BUG: Webhook system reliability issues causing missed updates in v1.7.31 (replay protection, instance matching, SSE) #62
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Related to: Season pack queue handling (#61) – webhooks are the primary trigger for queue refreshes that feed the broken season pack data path.
Description:
Webhooks from Sonarr, Radarr, and Ombi frequently fail to trigger real-time dashboard/SSE updates ("not working again" in v1.7.31). This regressed or became more noticeable after the poller/SSE test expansions and frontend changes in this release, even though no direct webhook logic was modified.
Detailed Investigation Findings (release/1.7.31)
1. Overly Strict Replay Protection (
server/routes/webhook.js)isReplay(eventType, instanceName, eventDate)uses a simple key:`${eventType}:${instanceName || ''}:${eventDate}`(or`${requestId}-${eventDate}`for Ombi).datewith sub-second variations, timezone differences, or identical values for rapid events (e.g., Grab → Download).200 { received: true, duplicate: true }and completely skipprocessWebhookEvent()+pollAllServices()(SSE broadcast).eventDate(e.g., to minute precision) and no content-hash fallback.2. Brittle Instance Resolution
const inst = sonarrInstances.find(i => i.name === instanceName || i.id === instanceName) || sonarrInstances[0];instanceNamefrom *arr often doesn't exactly match configurednameorid→ falls back to first instance.cache.updateWebhookMetrics()and incorrect cache keys for multi-instance users.3. Ombi-Specific Fragility (despite query-param secret fix in commit
7b9c895)validatePayload().extractRequestedUser()logic inprocessWebhookEvent('ombi', ...)can fail silently on certain payloads/Ombi versions, leavingpoll:ombi-requestsstale.4. Fire-and-Forget + SSE Dependency
processWebhookEvent(...).catch(err => log...)only logs.await pollAllServices()(which triggers SSE to all connected clients) can fail without user-visible feedback.5. Interaction with Poller & Queue Refresh
arrRetrieverRegistry.getQueuesByType()→PollingSonarrRetriever.getQueue()(which has the season pack bug tracked in #61).Impact:
Proposed Solution / Fix Plan:
Replay Protection Hardening (High Priority)
eventDateto minute precision or use a stable content hash of key fields (eventType + title + downloadId).?force=truequery param for testing/admin bypass.Instance Matching Improvements
Ombi Hardening
validatePayloadOmbi()version.Observability
/api/statusor new debug endpoint.pollAllServices()errors are caught and logged with context.Cross-Dependency Note
Suggested Labels:
Kind/Bug, Priority: High, Area/Webhooks, Area/SSE, Compat/Non-Breaking
Affected Versions: v1.7.27 – v1.7.31 (replay protection introduced earlier; became painful with increased webhook usage and poller changes).