BUG: Sonarr and Radarr webhook test buttons report failure after #62 #71
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 Issues:
Priority: High
Status: Open
Description
After the changes in #62, the Sonarr and Radarr webhook test buttons now report failure, even though real webhooks may still function.
Clicking the test button results in the webhook being rejected as a duplicate.
Root Cause
The improved replay protection in #62 introduced a 4-parameter
isReplay()function:In the Sonarr and Radarr handlers,
contentIdis extracted as:Problem:
Webhook test events sent by the UI use
eventType: "Test"and do not containdownloadId,series.id, ormovie.id.This results in
contentId = null.The replay key becomes:
When the test button is clicked more than once within the 5-minute replay window (or when
eventDatehas second-level precision), the key collides →isReplay()returnstrue→ the test event is rejected as a duplicate.This is a side effect of the stricter replay protection introduced in #62.
Evidence from Current Code
Sonarr Handler:
Radarr Handler:
Typical Test Payload (from UI):
→ No media identifiers →
contentId = null→ false duplicate detection.Impact
How to Resolve (Recommended Fix)
Best Solution: Skip replay protection for
eventType === "Test"events.Patch for
server/routes/webhook.jsAdd the following check in both the Sonarr and Radarr handlers, right after payload validation:
Full Recommended Replacement (Sonarr handler example):
Apply the same pattern to the Radarr handler.
Suggested Commit Message
Suggested Labels
Kind/BugPriority: HighArea/WebhooksRegressionCross-References
Resolved in commit
06818db.