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

[Telegram] Webhook "Active" flag ignored #19220

Closed
bryanpedini opened this issue Mar 26, 2022 · 4 comments · Fixed by #19234
Closed

[Telegram] Webhook "Active" flag ignored #19220

bryanpedini opened this issue Mar 26, 2022 · 4 comments · Fixed by #19234
Labels
Milestone

Comments

@bryanpedini
Copy link

Description

I noticed that after configuring a Telegram webhook, new repos in a private org trigger the webhook too, even private repos themselves (but this is a separate issue).

I then disabled the webhook by unflagging the "Active" section in the webhook settings, tho it still sends out Telegram messages via the bot.

In the logs I flag the webhook enabled, save the webhook configuration, disable it again and save it again, create a test repository, and finally delete it.

Gitea Version

1.16.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/bryanpedini/3f191cf3b8ae706541f511e809961282

Screenshots

N/A

Git Version

2.20.1

Operating System

Debian 10 + official Docker image

How are you running Gitea?

Docker Compose stack: deployments/gitea

Database

MySQL

@zeripath
Copy link
Contributor

Is this a system webhook or a repository webhook?

zeripath added a commit to zeripath/gitea that referenced this issue Mar 27, 2022
…o active hooks

There is a bug in the system webhooks whereby the active state is not checked when
webhooks are prepared and there is a bug that deactivating webhooks do not prevent
queued deliveries.

* Only add SystemWebhooks to the prepareWebhooks list if they are active
* At the time of delivery if the underlying webhook is not active mark it
as "delivered" but with a failed delivery so it does not get delivered.

Fix go-gitea#19220

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor

I've noticed a few bugs - which assuming that these represent your problems then should they should fix the problem.

@bryanpedini
Copy link
Author

I've noticed a few bugs - which assuming that these represent your problems then should they should fix the problem.

Thank you a lot Zeripath!!

Is this a system webhook or a repository webhook?

Sorry for the missing information, it was a system-wide wehbook that sent a Telegram notification whenever action X happened on the Gitea server.

Would it be possible to take a look at why it sends webooks even for private repos too? Or is it "normal" behavior?

@zeripath
Copy link
Contributor

A system webhook runs on every webhook - that is why it is a system webhook.

wxiaoguang pushed a commit that referenced this issue Mar 28, 2022
…o active hooks (#19234)

There is a bug in the system webhooks whereby the active state is not checked when
webhooks are prepared and there is a bug that deactivating webhooks do not prevent
queued deliveries.

* Only add SystemWebhooks to the prepareWebhooks list if they are active
* At the time of delivery if the underlying webhook is not active mark it
as "delivered" but with a failed delivery so it does not get delivered.

Fix #19220

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
…o active hooks (go-gitea#19234)

There is a bug in the system webhooks whereby the active state is not checked when
webhooks are prepared and there is a bug that deactivating webhooks do not prevent
queued deliveries.

* Only add SystemWebhooks to the prepareWebhooks list if they are active
* At the time of delivery if the underlying webhook is not active mark it
as "delivered" but with a failed delivery so it does not get delivered.

Fix go-gitea#19220

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
zeripath added a commit to zeripath/gitea that referenced this issue Mar 29, 2022
…o active hooks (go-gitea#19234)

Backport go-gitea#19234

There is a bug in the system webhooks whereby the active state is not checked when
webhooks are prepared and there is a bug that deactivating webhooks do not prevent
queued deliveries.

* Only add SystemWebhooks to the prepareWebhooks list if they are active
* At the time of delivery if the underlying webhook is not active mark it
as "delivered" but with a failed delivery so it does not get delivered.

Fix go-gitea#19220

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6543 pushed a commit that referenced this issue Mar 29, 2022
…o active hooks (#19234) (#19248)

Backport #19234

There is a bug in the system webhooks whereby the active state is not checked when
webhooks are prepared and there is a bug that deactivating webhooks do not prevent
queued deliveries.

* Only add SystemWebhooks to the prepareWebhooks list if they are active
* At the time of delivery if the underlying webhook is not active mark it
as "delivered" but with a failed delivery so it does not get delivered.

Fix #19220

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.16.6 milestone Apr 2, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants