BUG: /sync-folder does not validate the supplied folder_id
Maintainers usually reply within 4 days
@sathvikn113 is already working on this.
Since Nov 17, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read sync_folder() in app/routes/folders.py and the folder lookup helpers in app/database/folders.py, starting with db_get_folder_path_from_id(). Add regression tests for an existing and a nonexistent folder_id; done means a missing folder returns 404 before synchronization makes database changes.
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?
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
- Dominant language
- Python
- Stars
- 322
- Forks
- 793
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Possibly taken @jayssSmm claimed this 1 day ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1780 · 5 comments ·
Maintainers usually reply within 4 days
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workPossibly taken @swastiksharma45 claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/PictoPy#1779 · 2 comments ·
Maintainers usually reply within 4 days
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is offPossibly taken @dhruvbit claimed this 3 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AOSSIE-Org/PictoPy#1770 · 3 comments ·
Maintainers usually reply within 4 days
-
BUG: Add images to album: success message shows requested count, not number actually addedPossibly taken @riyanshbhosale claimed this 5 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/PictoPy#1740 · 4 comments ·
Maintainers usually reply within 4 days
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md referencesMay be free again @avika269 claimed this 10 days ago, and no pull request is open. Opendocumentation
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
AOSSIE-Org/PictoPy#1730 · 5 comments ·
Maintainers usually reply within 4 days
All issues in AOSSIE-Org/PictoPy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
bad-antics/lateralus-lang#1140 ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
fixture good first issue help wanted vendor:cisco
Difficulty 1/5 1-3 hours Newbie friendliness 85/100