[Bug]: Renaming a library to an existing name merges the two libraries
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Start at src/api/settings.rs:306 in updateLibrary, where the rename is committed before config.update_library runs. Read Config::validate to see where the duplicate-name check lives, then reorder or pre-validate so the name is checked against the other libraries before any database write. Done means renaming A to B returns the "two libraries are called" error with no items, tracks, stars, ratings or permission lists relabeled; the issue notes this was found by reading code and not yet reproduced, so build a two-library case first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.
Version
0.40.0 (feat/desktop, 017a837b)
Area
Config
What happened?
updateLibrary renames the library in the database and commits (src/api/settings.rs:306) before calling config.update_library, which is where duplicate names are rejected (Config::validate). Renaming A to an existing B relabels all of A's items, skipped files, tracks, albums, artists, stars and ratings as B, then returns an error. The config still lists both libraries, and A's titles now show up in B. Permission lists are renamed only after the commit, so they're left pointing at A.
Steps to reproduce
- Have two libraries, A and B.
- Rename A to B in settings: you get "two libraries are called "B"".
- B now contains A's titles and A is empty.
Expected behavior
The rename is refused before anything in the database changes.
Suggested fix
Validate the new name against the other libraries first (or apply the config change first and only rename in the DB once it succeeded).
- Ngôn ngữ chính
- TypeScript
- Star
- 4
- Fork
- 1
- Merge trung bình
- 4 giờ 49 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 tinystream-dev/tinystream
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tinystream-dev/tinystream#132 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tinystream-dev/tinystream#131 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
tinystream-dev/tinystream#129 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
tinystream-dev/tinystream#128 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tinystream-dev/tinystream#124 ·
Tất cả issue của tinystream-dev/tinystream
Issue tương tự
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
sandbox-quantum/switch#2163 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/dashboard kind/bug QA/dev-automation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pydantic/pydantic-ai#13939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
self-host
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
funmusicplace/mirlo#2625 ·
Maintainer thường phản hồi trong vòng 1 ngày