BUG: Add images to album: success message shows requested count, not number actually added
Maintainer thường phản hồi trong vòng 10 ngày
@avika269 đang làm issue này rồi.
Từ ngày 18/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
Đọc backend/app/routes/albums.py và backend/app/database/albums.py để theo dõi hàm cơ sở dữ liệu chèn bao nhiêu hàng và route tạo phản hồi như thế nào. Thêm các bài kiểm thử route và cơ sở dữ liệu cho trường hợp IDs hợp lệ và không hợp lệ xen lẫn, IDs đã có trong album và IDs lặp lại; thông báo thành công phải cho biết số lượng thực sự được thêm. Chạy các bài kiểm thử liên quan đến những tệp này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
What happened?
I was reading through the album routes and noticed the "Added N images" message uses the length of the request, not what was actually inserted.
Where
backend/app/routes/albums.py (~line 375):
db_add_images_to_album(album_id, body.image_ids)
request_metadata_export(app_state)
return SuccessResponse(
success=True, msg=f"Added {len(body.image_ids)} images to album"
)
db_add_images_to_album() in backend/app/database/albums.py only inserts IDs that exist in images, uses INSERT OR IGNORE, and returns nothing, so the route can't know how many rows were really added.
What I think happens
- One existing ID plus one nonexistent ID: one row should be inserted, but the message should say "Added 2 images to album".
- An ID already in the album is skipped by
INSERT OR IGNOREbut should still be counted in the message. - A repeated ID in one request should be counted twice in the message but inserted once.
I found this by reading the code and the existing tests. The existing 404 test mocks the DB function, so mixed valid/invalid IDs aren't covered.
Possible fix
Return cursor.rowcount from db_add_images_to_album() and use it in the route message, plus a route test and a DB test for the mixed and already-in-album cases.
Record
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Python
- Star
- 320
- Fork
- 771
- Merge trung bình
- 9 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/PictoPy
-
BUG: /sync-folder does not validate the supplied folder_idCó thể đã có người làm @sathvikn113 đã nhận 4 ngày trước. Đang mởbug possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/PictoPy#1731 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md referencesCó thể đã có người làm @avika269 đã nhận 4 ngày trước. Đang mởdocumentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
AOSSIE-Org/PictoPy#1730 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
BUG: onSuccess in useMutationFeedback triggers repeated executions / infinite re-render loopĐang mởbug possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AOSSIE-Org/PictoPy#1729 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
BUG: Memory curator misses upcoming anniversaries across year boundaries and on leap daysCó thể đã có người làm @akhilmodi29 đã nhận 5 ngày trước. Đang mởbug possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
AOSSIE-Org/PictoPy#1725 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
BUG: Album create/update accept a blank or whitespace-only nameCó thể đã có người làm @sayxnn17 đã nhận 3 ngày trước. Đang mởbug possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
AOSSIE-Org/PictoPy#1722 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
Tất cả issue của AOSSIE-Org/PictoPy
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Niko1221/Strata#6475 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
skills: _skill_body cuts the frontmatter short when a description contains ---Có thể đã có người làm @nurlanmnn đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
zilliztech/memsearch#876 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
acl-org/acl-anthology#11025 ·
Maintainer thường phản hồi trong vòng 1 ngày