BUG: /sync-folder does not validate the supplied folder_id
メンテナーはふだん 10 日以内に返信
@sathvikn113 がすでに取り組んでいます。
2026年11月17日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
app/routes/folders.py の sync_folder() と、app/database/folders.py のフォルダー検索ヘルパーを読み、まず db_get_folder_path_from_id() を確認してください。存在する folder_id と存在しない folder_id の回帰テストを追加してください。フォルダーが見つからない場合に、同期によるデータベースの変更が行われる前に 404 が返されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 320
- フォーク
- 771
- 平均マージ
- 9日 5時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @avika269 が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 2 件 ·
メンテナーはふだん 10 日以内に返信
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md references対応中かも @avika269 が 4 日前に担当しました。 オープンdocumentation
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
AOSSIE-Org/PictoPy#1730 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
-
bug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/PictoPy#1729 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
-
BUG: Memory curator misses upcoming anniversaries across year boundaries and on leap days対応中かも @akhilmodi29 が 5 日前に担当しました。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
AOSSIE-Org/PictoPy#1725 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
-
BUG: Album create/update accept a blank or whitespace-only name対応中かも @sayxnn17 が 3 日前に担当しました。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
AOSSIE-Org/PictoPy#1722 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Niko1221/Strata#6475 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
skills: _skill_body cuts the frontmatter short when a description contains ---対応中かも @nurlanmnn が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zilliztech/memsearch#876 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
acl-org/acl-anthology#11025 ·
メンテナーはふだん 1 日以内に返信