Sync update to a missing content node is marked applied

Aberta
#6,412 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
api, backend, testing

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
JavaScript
Estrelas
214
Forks
327
Merge médio
17h 5min
PRs com merge (30d)
25

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de learningequality/studio

Todas as issues de learningequality/studio

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.