Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(lyrics): stop auto-upgrade from overwriting user-authored lyrics (#203) (#215)

2 months ago

525a2c7
Authored
Davy7/25/2026, 7:10:54 PM
The silent lyrics auto-upgrade fired on song open could replace hand-entered
manual lyrics (and user-provided sidecar files) with an online synced match —
potentially a wrong match for a mistagged song — with no prompt and no undo.

Frontend: exclude manual_* and sidecar_* sources from the store auto-upgrade
so it never fires for user-authored/provided lyrics. Only embedded (and
absent) origins are silently upgraded.

Backend (belt-and-suspenders): thread a `user_initiated` flag through
fetch_lyrics_online. During auto-upgrade (user_initiated = false) the cache
upsert preserves any existing entry whose source is not embedded/absent,
so a background upgrade can never clobber Manual*/Sidecar* content. The
explicit "fetch lyrics online" action passes user_initiated = true and still
replaces the entry.

Tests: Rust tests assert apply_online_lyrics_result preserves Manual/Sidecar
entries during auto-upgrade, upgrades embedded, and replaces on user-initiated
fetch; a store test asserts fetchLyricsOnline is not called for any manual or
sidecar source variant.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Parent1881b6c

8 files changed
  • src-tauri/src/commands/lyrics.rs+227−42
  • src/components/Library/song-list-item-context-menu-build.test.ts+1−1
  • src/components/Library/song-list-item-context-menu-build.ts+1−1
  • src/lib/tauri/lyrics.ts+11−2
  • src/lib/tauri/tauri-wrappers.test.ts+3−2
  • src/stores/lyrics-store.test.ts+36−1
  • src/stores/lyrics-store.ts+25−3
  • src/types/ipc-contract.test.ts
+1
−1