The notification feature is working on single endpoint, but for multiple endpoints it seems not working. Not sure if my configuration is incorrect or slack has weird limitation. Any suggestion ? guys:)
I tried to configure 2 notification endpoints to 2 of my team's slack channels webhook, e.g.
A and B
Then only the first channel A get notified, then I tried to exchange the 1st configure item with the 2nd one like B and A, then still the new first one B channel get notified.
Check out the config.yaml snippet.
My test environment is on latest master branch:
commit c570cf21a37fe7d7e2c7eada3938ff42fc274bb0
Author: Juan Picado @jotadeveloper <[email protected]>
Date: Sun Oct 8 09:13:54 2017 +0200
config.yaml file snippet
notify:
'slack-general':
method: POST
headers: [{'Content-type': 'application/x-www-form-urlencoded'}]
endpoint: https://hooks.slack.com/services/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
content: '{ "text": "Package *{{ name }}* published to version *{{ dist-tags.latest }}*", "username": "npm.dianrong.com", "icon_emoji": ":package:" }'
'slack-npm-dianrong-com':
method: POST
headers: [{'Content-type': 'application/x-www-form-urlencoded'}]
endpoint: https://hooks.slack.com/services/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
content: '{ "text": "Package *{{ name }}* published to version *{{ dist-tags.latest }}*", "username": "npm.dianrong.com", "icon_emoji": ":package:" }'
No error message from log.

It is the problem:
we have return inside the loop, return stops execution and exits the function. return always exits its function immediately, with no further execution if it's inside a loop.
Sending a PR to correct this.
Cool thanks @ayusharma ! I'll cook a new version after your PR.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
It is the problem:
https://github.com/verdaccio/verdaccio/blob/c570cf21a37fe7d7e2c7eada3938ff42fc274bb0/src/lib/notify.js#L72
we have
returninside the loop,returnstops execution and exits the function. return always exits its function immediately, with no further execution if it's inside a loop.Sending a PR to correct this.