Sync change handlers report malformed changes as internal errors
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 69/100
Direzione di ricerca
Read the three named validation paths in contentcuration/viewsets/contentnode.py, base.py, and assessmentitem.py, then inspect the related sync change tests. Reproduce the malformed inputs listed in the issue and add regression tests for each. Done means each is reported as a validation error with a useful message and none is sent to Sentry.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Overview
Some sync change handlers raise exceptions other than DRF's ValidationError on malformed changes. The sync applier catches them, marks the change errored with "Internal server error", and reports each one to Sentry. The client gets no usable error, and Sentry fills with reports of client mistakes. Any channel editor can send these changes.
Complexity: Medium
Target branch: hotfixes
Context
All inputs below were reproduced:
ContentNodeSerializer.validatereadskind.kindwithout checkingkindis set. A contentnode create change with aparentand nokindraisesAttributeError: 'NoneType' object has no attribute 'kind'. An update change for a node that doesn't exist reaches the same line; #6412 covers that case.UpdateModelMixin._map_update_changecallschange["mods"].items(). An update change withmods: ["a"]raisesAttributeError.AssessmentItemSerializer.validate_answersandvalidate_hintscalljson.loadsand iterate the result unchecked.answers: "not json"raisesJSONDecodeError, andhints: "5"raisesTypeError.
The Change
- Each handler in Context should raise DRF
ValidationErrorfor these inputs, so the change is marked errored with a validation message and nothing is reported to Sentry.
Acceptance Criteria
General
- Each change in Context is marked errored with a message describing the problem, not "Internal server error".
- None of the changes in Context sends a report to Sentry.
Testing
- Each change in Context has a regression test.
AI usage
I scoped the audit and chose the validation strategy in #6387. Claude Code found and reproduced these failures and drafted this issue.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 321
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/studio
-
Community library status changes don't update `date_updated`Forse già presa @ArpitaSamanta10 l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
learningequality/studio#6414 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
learningequality/studio#6410 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
learningequality/studio#6409 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6407 ·
I maintainer di solito rispondono entro 1 giorno
-
Stripe webhook accepts events when no webhook secret is configuredForse già presa @adibmbrk l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6404 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/studio
Issue simili
-
area: ci bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hffgzktbcc-blip/ounce-core#484 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ranxianglei/billion-context#7063 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
MakazhanAlpamys/Soup#2971 ·
I maintainer di solito rispondono entro 1 giorno