BUG: Face search leaves temp files in a relative temp_uploads/ folder
メンテナーはふだん 3 日以内に返信
評価
調査の方向性
Start in backend/app/routes/face_clusters.py around face_tagging() and trace how the uploaded image reaches perform_face_search and how the finally block cleans it up. Check the existing user data directory and test layout before choosing an approach. Add coverage for cleanup after success and when face search raises; done when uploads do not remain in a relative temp_uploads/ folder and the cleanup test passes.
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
What happened?
BUG: Face search leaves temp files in a relative temp_uploads/ folder
What happened?
When face search is called with a base64 image, face_tagging() in
backend/app/routes/face_clusters.py (around line 357) writes the upload to
a hardcoded relative folder:
temp_dir = "temp_uploads"
os.makedirs(temp_dir, exist_ok=True)
Problems:
- The path is relative to the process's working directory, so the folder
appears wherever the backend was launched (e.g. the repo root or backend/
in dev) and its location differs between dev and the packaged app. - temp_uploads/ is not in .gitignore, so it can be accidentally committed.
- Cleanup happens in a finally block, but if the process is killed
mid-request (app quit, crash) the uploaded image stays on disk. Nothing
removes leftovers on the next start. For a privacy-first app, user
photos lingering in an unmanaged folder is undesirable.
Found by reading the code; not yet reproduced at runtime.
Suggested fix
- Use Python's tempfile (NamedTemporaryFile / mkstemp) or a subfolder of
the existing user data dir instead of "temp_uploads". - If perform_face_search can accept bytes/an array, skip writing to disk.
- Add a test covering that the temp file is removed after the request,
including when face search raises.
Record
- I agree to follow this project's Code of Conduct
- 主要言語
- Python
- スター
- 322
- フォーク
- 793
- 平均マージ
- 6日 10時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
bug enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AOSSIE-Org/PictoPy#1802 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
BUG: XMP metadata export permanently overwrites file modification timestamp (mtime), destroying photo dates対応中かも @swastiksharma45 が 2 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/PictoPy#1788 · コメント 6 件 ·
メンテナーはふだん 3 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
AOSSIE-Org/PictoPy#1786 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)対応中かも @omkar-suryavanshi が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/PictoPy#1780 · コメント 5 件 ·
メンテナーはふだん 3 日以内に返信
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't work対応中かも @ManyaJain111 が 2 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/PictoPy#1779 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"対応中かも @cestercian が今日担当しました。 オープンcomp/cli P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#162259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
upstream update
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
conan-io/conan-center-index#31597 ·
メンテナーはふだん 1 日以内に返信
-
community-request
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA-NeMo/Run#727 ·
メンテナーはふだん 1 日以内に返信
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
pytorch/pytorch#207247 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信