Generic webhooks: broken, unused, and not org-scoped. Fix or remove?
Maintainers usually reply within 7 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by tracing webhook dispatch in src/app/services/validation.py:175, then inspect the webhook model, CRUD, schemas, /webhooks endpoint, and migrations mentioned in the issue. The issue presents two unresolved options: remove the mechanism or make it org-scoped with a public payload schema; confirm the project’s decision before changing anything. Done means implementing the selected option consistently, including the database migration.
Written by the indexing model from the issue text.
Description
Context
The generic webhook mechanism (introduced in #367) sends every validated detection to every URL in the webhooks table (src/app/services/validation.py:175). Nothing uses it today:
- Slack notifications go through
organization.slack_hook/slack_client(#478), not this table. - The only row we knew of in prod was a leftover Slack URL from before #478. It never worked and only produced
400 invalid_payloadlog noise. It has been deleted. - Rows can only be added through the admin
/webhooksendpoint. The Python client does not expose it.
Problems if we keep it
- Double-encoded payload.
dispatch_webhookpassesmodel_dump_json()(astr) to httpxjson=, so consumers receive a quoted JSON string instead of an object. #623 fixes this. - No org scoping.
Webhookhas noorganization_idandWebhookCRUD.fetch_all()is global, so every webhook receives every organization's detections. A partner registered here would see other orgs' data. - Raw DB row as payload. We send the
Detectionrow as-is (bucket_key,crop_bucket_key,pose_id, etc.). There is no public schema, so any change to the model silently breaks consumers.
Options
- A. Remove it. Drop the model, endpoint, CRUD, schemas and the dispatch loop, and add a migration to drop
webhooks. Close #623. - B. Make it usable. Merge #623, add
organization_idtoWebhookand filter dispatch by the sequence's org, and send a dedicated public payload schema (alert id, camera, location, azimuth, timestamps, platform URL) instead of the raw row.
- Dominant language
- Python
- Stars
- 31
- Forks
- 15
- Avg merge
- 7d 18h
- Merged PRs (30d)
- 17
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyronear/pyro-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 7 days
-
endpoint: detections type: fix
Difficulty 4/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 7 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 7 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 7 days
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Maintainers usually reply within 7 days
All issues in pyronear/pyro-api
Similar issues
-
area: ci enhancement perceived difficulty: 1
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Nitjsefnie-Harness-Commons/daedalus#1826 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vllm-project/vllm-sail#398 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
DiamondLightSource/sm-bluesky#476 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100