BUG: Dead/inconsistent PRAGMA case_sensitive_like in get_db_connection (affects no queries today, latent footgun)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Read backend/app/database/connection.py and backend/app/database/folders.py first, then inspect the four get_db_connection call sites in albums.py and the folder-prefix query. Determine whether the pragma is dead configuration or intended behavior; done means the chosen behavior is applied consistently without silently changing subfolder prefix matching.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- 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
- I agree to follow this project's Code of Conduct
- Dominant language
- Python
- Stars
- 289
- Forks
- 685
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/PictoPy
-
bug possible-duplicate
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/PictoPy#1553 · 4 comments ·
-
BUG: Compiled .pyc committed under .github/scripts, root .gitignore does not ignore __pycache__ Openbug enhancement possible-duplicate
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AOSSIE-Org/PictoPy#1544 · 5 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/PictoPy#1541 · 6 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AOSSIE-Org/PictoPy#1535 · 1 comment ·
-
bug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AOSSIE-Org/PictoPy#1533 · 2 comments ·
All issues in AOSSIE-Org/PictoPy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100