BUG: /sync-folder does not validate the supplied folder_id
Los mantenedores suelen responder en 10 días
@sathvikn113 ya está trabajando en esto.
Desde el 17/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee sync_folder() en app/routes/folders.py y las funciones auxiliares de búsqueda de carpetas en app/database/folders.py, empezando por db_get_folder_path_from_id(). Añade pruebas de regresión para una folder_id existente y otra inexistente; la tarea está terminada cuando una carpeta inexistente devuelve 404 antes de que la sincronización realice cambios en la base de datos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Problem
While going through the /sync-folder implementation, I noticed that it doesn't check whether the given folder_id actually exists in the database before starting the sync operation.
Where I found the issue
In app/routes/folders.py, the sync_folder() function fetches the child folders using the ID passed in the request:
db_child_folders = db_get_direct_child_folders(request.folder_id)
But there is no check before this to confirm that the folder exists.
I also noticed that db_update_parent_ids_for_subtree() in app/database/folders.py updates parent_folder_id using a regular SQLite connection without enabling foreign-key enforcement. This means an invalid parent ID can be stored in the database.
Expected behaviour
The endpoint should check whether the supplied folder_id exists before proceeding with synchronization. If it doesn't exist, it should return a 404 response without making any database changes.
Possible approach
We could use db_get_folder_path_from_id() in sync_folder() to check whether the folder exists before proceeding.
I would like to work on this and add the necessary regression tests. Please let me know if this behaviour and approach look correct.
Record
- I agree to follow this project's Code of Conduct
- Lenguaje dominante
- Python
- Estrellas
- 320
- Forks
- 771
- Merge medio
- 9 d 5 h
- PR fusionados (30 d)
- 15
Preparar el entorno
- Sin Dockerfile ni 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 AOSSIE-Org/PictoPy
-
BUG: Add images to album: success message shows requested count, not number actually addedPosiblemente ocupada @avika269 la tomó hace 3 días. Abiertobug enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
AOSSIE-Org/PictoPy#1740 · 2 comentarios ·
Los mantenedores suelen responder en 10 días
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md referencesPosiblemente ocupada @avika269 la tomó hace 4 días. Abiertodocumentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
AOSSIE-Org/PictoPy#1730 · 5 comentarios ·
Los mantenedores suelen responder en 10 días
-
BUG: onSuccess in useMutationFeedback triggers repeated executions / infinite re-render loopAbiertobug possible-duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/PictoPy#1729 · 4 comentarios ·
Los mantenedores suelen responder en 10 días
-
BUG: Memory curator misses upcoming anniversaries across year boundaries and on leap daysPosiblemente ocupada @akhilmodi29 la tomó hace 5 días. Abiertobug possible-duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
AOSSIE-Org/PictoPy#1725 · 4 comentarios ·
Los mantenedores suelen responder en 10 días
-
BUG: Album create/update accept a blank or whitespace-only namePosiblemente ocupada @sayxnn17 la tomó hace 3 días. Abiertobug possible-duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
AOSSIE-Org/PictoPy#1722 · 5 comentarios ·
Los mantenedores suelen responder en 10 días
Todos los issues de AOSSIE-Org/PictoPy
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
needs-format
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Niko1221/Strata#6475 · 1 comentario ·
Los mantenedores suelen responder en 6 días
-
skills: _skill_body cuts the frontmatter short when a description contains ---Posiblemente ocupada @nurlanmnn la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zilliztech/memsearch#876 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
acl-org/acl-anthology#11025 ·
Los mantenedores suelen responder en 1 día