Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
In SG 2.8.1 and later we added an opt-in config option to only fire the document_changed webhook event handler when the document being changed is the winning revision.
This avoids webhook spam when resolving conflicts by removing old non-winning revisions of documents.
Note: Setting this still allows for duplicate revisions to be sent to a webhook URL, if a previously winning revision is made the winner again (after tombstoning the current winning revision/branch). Clients still need to ensure they have appropriate handling for duplicate events.
https://docs.couchbase.com/sync-gateway/current/configuration-schema-database.html#event_handlers
https://docs.couchbase.com/sync-gateway/current/webhooks.html
Example of this in use in a SG database config:
{
|
"bucket": "b1",
|
"num_index_replicas": 0,
|
"event_handlers": {
|
"document_changed": [
|
{
|
"handler": "webhook",
|
"url": "http://127.0.0.1:49571?event=WinningRevChanged",
|
"options": {
|
"winning_rev_only": true
|
}
|
}
|
]
|
}
|
}
|