Sync change handlers report malformed changes as internal errors
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 69/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 212
- Forks
- 321
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus learningequality/studio
-
Community library status changes don't update `date_updated`Evtl. vergeben @ArpitaSamanta10 hat das heute übernommen. Offencommunity-contribution-in-progress DEV: backend good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
learningequality/studio#6414 · 8 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
learningequality/studio#6410 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
learningequality/studio#6409 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/studio#6407 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Stripe webhook accepts events when no webhook secret is configuredEvtl. vergeben @adibmbrk hat das heute übernommen. Offencommunity-contribution-in-progress DEV: backend good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/studio#6404 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in learningequality/studio
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
audit-reference-check
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
site-bug triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
canonical/paas-charm#407 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 5 Tagen