Sync update to a missing content node is marked applied

Abierto
#6,412 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
api, backend, testing

Línea de trabajo

Read BulkUpdateMixin.update_from_changes in contentcuration/contentcuration/viewsets/base.py around lines 880–894, then inspect its serializer and missing-key handling. Add regression tests for missing single and composite keys and for a failed bulk update with missing keys; done means all three cases mark changes errored and preserve the "Not found" and bulk update errors.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

When a sync update change targets an object that doesn't exist, update_from_changes should mark the change "Not found". For models keyed by a single id, such as content nodes, the check never matches, so the change is marked applied with no error and the client believes the update was saved.

Complexity: Low
Target branch: hotfixes

Context
  • BulkUpdateMixin.update_from_changes tests tuple(change["key"]) in serializer.missing_keys. For a string key, tuple() produces a tuple of its characters, which never equals the string keys in missing_keys.
  • The same block assigns errors afresh when there are missing keys, discarding the "Internal server error" entries the except branch above it added.
  • Reproduced: a contentnode update change with mods: {"parent": ..., "kind": ...} for an id that doesn't exist is marked applied=True, errored=False.
The Change
  • An update change whose object doesn't exist should be marked errored with "Not found", for single and composite keys.
  • Errors from a failed bulk update should be kept alongside any "Not found" errors.
Acceptance Criteria
General
  • A contentnode update change for a nonexistent id is marked errored with "Not found".
  • An update change for a nonexistent composite key, such as an assessment item's, is still marked "Not found".
  • When the bulk update raises and some keys are missing, every change in the batch is marked errored.
Testing
  • Each criterion has a regression test.

AI usage

I scoped the audit. Claude Code found and reproduced this failure and drafted this issue.

Lenguaje dominante
JavaScript
Estrellas
214
Forks
327
Merge medio
17 h 5 min
PR fusionados (30 d)
25

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de learningequality/studio

Todos los issues de learningequality/studio

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.