BUG: Ombi webhook not actually enabled on Ombi side due to missing ID in settings payload #41
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?
Bug Description
While the Ombi webhook enable button no longer returns a 404, clicking it does not actually enable the webhook on the Ombi side. The webhook remains disabled.
Root Cause
server/routes/ombi.js,POST /api/ombi/webhook/enablecallsPOST {ombi}/api/v1/Settings/notifications/webhookwith the payload:WebhookNotificationViewModelschema contains anidproperty.idto be passed. If it is omitted or set to0, Entity Framework Core fails to perform the update on the single settings row, causing the change to not persist even if the HTTP request returns 200.Remediation Plan
server/routes/ombi.js, updatePOST /api/ombi/webhook/enableto first perform aGETrequest toGET {ombi}/api/v1/Settings/notifications/webhookto retrieve the current webhook configuration and its databaseid.idfrom the retrieved configuration into the payload of the subsequentPOSTrequest.Reopened and successfully closed via commit de71580756dfc5bb88b78c7d0cf05f297a1ce441 on the
developbranch.Added fetching of existing Ombi webhook settings prior to enabling the webhook. The retrieved settings
idis now merged back into thePOSTpayload. This guarantees that Entity Framework on the Ombi backend performs an update on the correct database row, enabling the webhook successfully and allowing its state to persist correctly.