mirror of
https://github.com/koel/koel.git
synced 2026-04-25 08:46:00 +03:00
[PR #2114] [MERGED] fix: add cache invalidation after library prune #2081
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#2081
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/koel/koel/pull/2114
Author: @Doppelkeks12
Created: 9/30/2025
Status: ✅ Merged
Merged: 10/12/2025
Merged by: @phanan
Base:
master← Head:fix/album-artist_cache-invalidation📝 Commits (8)
3a55d0ffix: add cache invalidation after library prune916feefRevert "fix: add cache invalidation after library prune"5442d15fix: use in-memory cache for ScannerCacheStrategy4933a76feat: make the maxCacheSize in ScannerCache configurable44e0cf8fix: fix Off-by-one error during cache eviction6b3b520refactor: use get/put for cache access0eb6876Update app/Services/Scanners/ScannerCacheStrategy.php89fc631Update app/Services/Scanners/ScannerCacheStrategy.php📊 Changes
5 files changed (+98 additions, -17 deletions)
View changed files
📝
app/Services/Scanners/Contracts/ScannerCacheStrategy.php(+0 -3)📝
app/Services/Scanners/ScannerCacheStrategy.php(+23 -9)📝
app/Services/Scanners/ScannerNoCacheStrategy.php(+0 -3)📝
app/Services/SongService.php(+0 -2)➕
tests/Unit/Services/Scanners/ScannerCacheStrategyTest.php(+75 -0)📄 Description
This commit clears the artist and album cache after they are deleted from the database.
It fixes a bug where, if a song is deleted along with its artist/album and immediately re-uploaded, the cache provides an invalid state.
Reproduction steps:
=> You got logged out. No Log in the laravel log, but in the response is "SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
db.songs, CONSTRAINTsongs_artist_id_foreignFOREIGN KEY (artist_id) REFERENCESartists(id) ON DELETE CASCADE ON UPDATE CASCADE) " (Maybe an issue on its own. I think the user should not be logged out, but gets an default error message. The SQL Error Log should be in the laravel log)Questions for Review:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.