[Bug]: Renaming a library to an existing name merges the two libraries
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 65/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[!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).
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 1
- Merge medio
- 4h 49m
- PR unite (30g)
- 5
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tinystream-dev/tinystream
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
tinystream-dev/tinystream#132 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
tinystream-dev/tinystream#131 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
tinystream-dev/tinystream#129 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
tinystream-dev/tinystream#128 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tinystream-dev/tinystream#124 ·
Tutte le issue di tinystream-dev/tinystream
Issue simili
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
sandbox-quantum/switch#2163 ·
I maintainer di solito rispondono entro 1 giorno
-
automated issue report
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
area/dashboard kind/bug QA/dev-automation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug pydanty:is-working
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
pydantic/pydantic-ai#13939 ·
I maintainer di solito rispondono entro 1 giorno
-
self-host
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
funmusicplace/mirlo#2625 ·
I maintainer di solito rispondono entro 1 giorno