Skip to content

Fix/cache validation - #6108

Closed
HarshitR2004 wants to merge 5 commits into
beetbox:masterfrom
HarshitR2004:fix/cache-validation
Closed

Fix/cache validation#6108
HarshitR2004 wants to merge 5 commits into
beetbox:masterfrom
HarshitR2004:fix/cache-validation

Conversation

@HarshitR2004

@HarshitR2004 HarshitR2004 commented Oct 18, 2025

Copy link
Copy Markdown

Description

Fixed cache invalidation bug in Library.add_album() where the _memotable cache was not cleared after adding albums, unlike the Library.add() method. This could lead to stale template cache data when adding albums with multiple items.

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

@HarshitR2004
HarshitR2004 requested a review from a team as a code owner October 18, 2025 17:05
Copilot AI review requested due to automatic review settings October 18, 2025 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes a cache invalidation bug where Library.add_album() failed to clear the _memotable cache after adding albums, causing potential stale template data issues.

  • Added cache clearing by setting _memotable to an empty dictionary after album insertion
  • Updated changelog to document the bug fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/changelog.rst Added changelog entry documenting the cache invalidation bug fix
beets/library/library.py Added cache clearing statement to match behavior in Library.add() method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@HarshitR2004
HarshitR2004 requested a review from Copilot October 18, 2025 17:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@semohr

semohr commented Oct 19, 2025

Copy link
Copy Markdown
Contributor

Thanks for submitting this PR and your interest in contributing to beets.

I took a look at the change and had some questions about the motivation. The original _memotable functionality (from #4438) was added for a specific reason related to singleton tracks. I'm not sure the same issue applies to albums, and the PR description doesn't clarify the specific problem this solves.

To help us understand, could you please provide:

  • A concrete example of the issue or bug this change fixes when working with albums.
  • The specific motivation or use case that led you to make this change.

As your contributions appears to be AI-generated to me, I will take a bit more caution here! Often such PRs "fix" non-existent issues without a clear understanding of the codebase. These can unintentionally introduce bugs. If that's not the case here, I apologize for the assumption, and I look forward to your clarification so we can move forward.

@HarshitR2004
HarshitR2004 deleted the fix/cache-validation branch October 19, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants