Skip to content

Fix get all albums from cached results#52

Merged
mib1185 merged 1 commit into
mainfrom
albums/fix-get_all-_albums-from-cache
May 18, 2026
Merged

Fix get all albums from cached results#52
mib1185 merged 1 commit into
mainfrom
albums/fix-get_all-_albums-from-cache

Conversation

@mib1185
Copy link
Copy Markdown
Owner

@mib1185 mib1185 commented May 18, 2026

We extended the first result with the second one, but as the first result comes from the cache, the cache object got extended every time and those duplicated the shared albums into it.

ref. home-assistant/core#169866

Copilot AI review requested due to automatic review settings May 18, 2026 19:47
Copy link
Copy Markdown

Copilot AI left a comment

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 bug where the cached non-shared albums list was being mutated by list.extend(), causing shared albums to be appended repeatedly across calls and resulting in duplicates.

Changes:

  • Replace in-place result.extend(result_shared) with a new-list concatenation result + result_shared to avoid mutating the cached result.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.28%. Comparing base (00b54a4) to head (aa2b8c5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   96.28%   96.28%   -0.01%     
==========================================
  Files          17       17              
  Lines         485      484       -1     
==========================================
- Hits          467      466       -1     
  Misses         18       18              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mib1185 mib1185 added the bug Something isn't working label May 18, 2026
@mib1185 mib1185 merged commit 4950320 into main May 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants