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 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
trezor/trezor-user-env#421 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1-3 小时 新手友好度 91/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
tangentcode/tangentswarm#167 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复