Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Webhooks sends wrong payload #2485

Closed
0xlee opened this issue Jan 27, 2016 · 9 comments
Closed

Multiple Webhooks sends wrong payload #2485

0xlee opened this issue Jan 27, 2016 · 9 comments
Labels
💊 bug Something isn't working status: needs feedback Tell me more about it
Milestone

Comments

@0xlee
Copy link

0xlee commented Jan 27, 2016

I had 2 webhooks registered to my gogs repository: to slack and to drone.
The slack webhook works fine, but the drone webhook has a payload that should be sent to slack, which leads to 500 error in drone.

If I remove the slack webhook, then the drone webhook works fine.

@unknwon
Copy link
Member

unknwon commented Jan 27, 2016

Thanks your feedback!

What's your Gogs version?

@unknwon unknwon added the status: needs feedback Tell me more about it label Jan 27, 2016
@unknwon unknwon added this to the 0.9.0 milestone Jan 27, 2016
@0xlee
Copy link
Author

0xlee commented Jan 27, 2016

I use gogs/gogs latest docker image, it's 0.8.23.0126.

@unknwon
Copy link
Member

unknwon commented Jan 27, 2016

Thanks. Does this problem happen 100%?

@unknwon unknwon removed this from the 0.9.0 milestone Feb 7, 2016
@unknwon
Copy link
Member

unknwon commented Feb 7, 2016

ping @mathicalee

@thehowl
Copy link
Contributor

thehowl commented Feb 10, 2016

I just got the same problem. And here's all the info I could get:

Custom built hook which gets push events works fine, and outputs standard payload.

Slack hook with default settings, outputs slack payload.

Drone hook which gets push events outputs slack payload.

They were ordered in the database in the same order I wrote them (std -> slack -> std)

Removing the slack hook, test delivery and everything's working smoothly. When I added back the slack hook, as it was added after the drone hook, everything worked smoothly again. So my best guess is that a value that switches between the two hook types is changed when it gets to a slack webhook, but it does not "change back" when it gets to a standard webhook.

Gogs version 0.8.31.0205

@unknwon
Copy link
Member

unknwon commented Feb 10, 2016

Removing the slack hook, test delivery and everything's working smoothly. When I added back the slack hook, as it was added after the drone hook, everything worked smoothly again. So my best guess is that a value that switches between the two hook types is changed when it gets to a slack webhook, but it does not "change back" when it gets to a standard webhook.

@thehowl thanks for the info!

@unknwon unknwon added the 💊 bug Something isn't working label Feb 10, 2016
@unknwon unknwon added this to the 0.9.0 milestone Feb 10, 2016
unknwon added a commit that referenced this issue Feb 10, 2016
When repository contains a Slack type hook,
it changes original payload content.

This patch fixes it by using a local object to store
newly created Slack payload instead of assigning
back to the same variable.
@unknwon
Copy link
Member

unknwon commented Feb 10, 2016

Just pushed a fix to develop branch, welcome to test on it and demo site.

@unknwon
Copy link
Member

unknwon commented Feb 17, 2016

ping @mathicalee

@unknwon
Copy link
Member

unknwon commented Feb 20, 2016

Close as fixed.

@unknwon unknwon closed this as completed Feb 20, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working status: needs feedback Tell me more about it
Projects
None yet
Development

No branches or pull requests

3 participants