AOSSIE-Org / AOSSIE-Org/PictoPy

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

Ouverte
#1,346 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
283
Forks
679
Merge moyen
7 j 2 h
PR mergées (30 j)
3

Description

### 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.