AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Dead/inconsistent PRAGMA case_sensitive_like in get_db_connection (affects no queries today, latent footgun)

Abierto
#1,346 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
283
Forks
679
Merge medio
7 d 2 h
PR fusionados (30 d)
3

Descripción

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

`backend/app/database/connection.py:23` sets `PRAGMA case_sensitive_like = ON` inside `get_db_connection()`. But that helper is only used in ~4 call sites (all in `albums.py`), and the **only `LIKE` query in the codebase** - `db_get_folder_ids_by_path_prefix` (`backend/app/database/folders.py:344`, `WHERE folder_path LIKE ? || '%'`) — uses a **raw `sqlite3.connect()`** that never runs the pragma.

So today the pragma changes the behaviour of **zero** queries (dead config). It becomes a latent footgun the moment any `LIKE` query is migrated onto `get_db_connection()`: subfolder prefix matching would silently turn case-sensitive and miss subfolders on case-insensitive filesystems (macOS/Windows).

**Fix:** remove the pragma (LIKE is case-insensitive by default), or - if case-sensitive LIKE is actually intended - apply it consistently and migrate the folder-prefix query onto the shared helper.

### Record

- [x] I agree to follow this project's Code of Conduct

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.