Sync change handlers report malformed changes as internal errors

Offen
#6,397 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
django, python
Bereich
api, backend, testing

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

DEV: backend

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:

The Change
  • Each handler in Context should raise DRF ValidationError for 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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus learningequality/studio

Alle Issues in learningequality/studio

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.