Webhook handler runs twice for an event if shadow bucket is configured at sync gateway database

I have created a database at sync gateway with shadow bucket configured for it. PFB config file for database:

"db3": {
    "server": "localhost:8091",
    "bucket": "test3",
    "shadow": {
      "server": "localhost:8091",
      "bucket": "test4"
    "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
"sync": `function(doc, oldDoc) {		
"event_handlers": {
    "document_changed": [
     {"handler": "webhook",
      "url": "http://localhost:49490/test"

When I upload a document, my api (http://localhost:49490/test) is hit twice. But when I remove shadow bucket from config, it works fine and hits my api only once.
Why does it run twice with shadow bucket configured? Is it intentional or a bug?

It does seem like a bug, I would open a ticket on the sync gateway bug tracker here: https://github.com/couchbase/sync_gateway/issues

@ldoguin I am not able to view the issue created by you for this on link mentioned above. Could you please provide me link for the issue so I can track its progress?

I have not created any issue as I don’t have that problem. I was inviting you to create that issue.

Created issue https://github.com/couchbase/sync_gateway/issues/1946