A sync change can modify a channel other than the one it names

Abierto
#6,413 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
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
django, python

Línea de trabajo

Start with SyncView.handle_changes in contentcuration/contentcuration/viewsets/sync/endpoint.py, then trace the contentnode create, update, and move handlers that use parent or target. Add tests for changes naming a different channel and run the relevant sync endpoint tests. Done means those mismatched changes are rejected without creating nodes or change records, while valid same-channel changes still work.

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

Descripción

DEV: backend

Overview

The sync endpoint checks that the user can edit the channel_id a change names, and records the change under that channel. Nothing checks that the parent or target of a contentnode create, update or move is in that channel. A user who edits two channels can send a change naming channel A that creates a node in channel B, and channel B records no change for it, so its unpublished-changes tracking misses the edit.

Complexity: Medium
Target branch: hotfixes

Context
  • SyncView.handle_changes sorts changes by their channel_id and creates the Change rows with it. The contentnode create, update and move handlers then place the node under whatever parent or target the change gives.
  • Reproduced: an editor of channels A and B sent a contentnode create change with channel_id A and parent set to B's root node. The node was created in B, the Change row was recorded under A, and B had no Change rows.
The Change
  • A contentnode create, update or move change should be rejected when its parent or target isn't in the channel the change names.
Acceptance Criteria
General
  • The reproduced change in Context is rejected with an error, and nothing is created in either channel.
  • Changes whose objects are in the named channel are applied as before.
Testing
  • Tests cover create, update and move changes whose parent or target is in a different channel from the one the change names.

AI usage

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

Lenguaje dominante
Python
Estrellas
212
Forks
321
Merge medio
1 d 7 h
PR fusionados (30 d)
14

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 Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.