Set unpublishable: true on PublishedChange by construction to simplify handleMaxRevs predicate
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript
- Área
- backend
Línea de trabajo
Comienza con los constructores de PublishedChange y PublishedNextChange en changes.js y, después, inspecciona el predicado lastChannelEditIndex en serverSync.js. Actualiza los constructores y elimina la condición de tipo redundante. Luego ejecuta las pruebas existentes de PublishedChange en changes.spec.js y verifica que unpublished_changes siga siendo correcto después de un evento de publicación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Current behavior
In serverSync.js, handleMaxRevs uses findLastIndex to compute two values for deciding whether to set unpublished_changes = true on a channel:
lastChannelEditIndex— the last publishable change, filtered (among other conditions) withc.type !== CHANGE_TYPES.PUBLISHEDlastPublishIndex— the last publish change, matched withc.type === CHANGE_TYPES.PUBLISHED
The predicate for lastChannelEditIndex already includes !c.unpublishable, making the explicit c.type !== CHANGE_TYPES.PUBLISHED check partially redundant: if PublishedChange always set unpublishable: true, the type check would be unnecessary.
Desired behavior
PublishedChange and PublishedNextChange set unpublishable: true by construction (in its constructor in changes.js), so the c.type !== CHANGE_TYPES.PUBLISHED guard in handleMaxRevs can be removed. The !c.unpublishable check alone is sufficient to exclude publish changes from lastChannelEditIndex.
This makes the semantics self-contained in the change object — callers don't need to know the type mapping — and reduces the risk of future change types being accidentally treated as publishable.
Acceptance Criteria
-
PublishedChangeconstructor inchanges.jssetsunpublishable: trueunconditionally - The
c.type !== CHANGE_TYPES.PUBLISHEDcondition is removed from thelastChannelEditIndexpredicate inhandleMaxRevs(serverSync.js) - Existing tests for
PublishedChangeinchanges.spec.jspass (updated if needed to assertunpublishable: true) -
unpublished_changescontinues to be set correctly after a publish event (no regression)
References
Follow-up to https://github.com/learningequality/studio/pull/5844#discussion_r3125011603
AI usage
This issue was drafted with Claude Code assistance from session context and code review.
- Lenguaje dominante
- Python
- Estrellas
- 191
- Forks
- 308
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 64
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de learningequality/studio
-
TAG: tech update / debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
learningequality/studio#2245 ·
Los mantenedores suelen responder en 1 día
-
bug DEV: frontend
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
learningequality/studio#6308 ·
Los mantenedores suelen responder en 1 día
-
bug DEV: frontend
Dificultad 3/5 1-2 días Aptitud para principiantes 20/100
learningequality/studio#6307 ·
Los mantenedores suelen responder en 1 día
-
bug DEV: backend python
Dificultad 3/5 1-2 días Aptitud para principiantes 30/100
learningequality/studio#6305 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
learningequality/studio#6304 ·
Los mantenedores suelen responder en 1 día
Todos los issues de learningequality/studio
Issues similares
-
Broken link in index.rstAbiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
ansys/pydpf-core#3547 ·
Los mantenedores suelen responder en 1 día
-
core
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
vectorize-io/hindsight#5457 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: LangChain drops OpenAI Responses text blocks from session recordingPosiblemente ocupada @ktz03 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
volcengine/OpenViking#5806 ·
Los mantenedores suelen responder en 1 día
-
HTML: <template> content is extracted as document textPosiblemente ocupada @ryanmeowy la tomó hoy. Abiertobug html
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
docling-project/docling#4714 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
APIv2 event data accepts a non-string reply and a NaN upper_boundPosiblemente ocupada @awss1i la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
freedomofpress/securedrop#7946 · 1 comentario ·
Los mantenedores suelen responder en 2 días