Spotify rate limit improvements#21254
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSpotify app helpers now change retry behavior, dedupe artist albums, and batch track lookups by album ID. The artist-track action and new-track source use the updated flow, and several action/source manifests plus the Spotify package version are bumped. ChangesSpotify track retrieval and version bumps
Sequence Diagram(s)
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The description has a summary but omits the required checklist sections for versioning, app integration, and CodeRabbit review. | Add the full Checklist section and explicitly confirm version bumps, app integration status, and acknowledgment of CodeRabbit review comments. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title is concise and matches the main theme of the PR: Spotify rate-limit and trigger efficiency improvements. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
spotify-improvements
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/spotify/sources/new-track-by-artist/new-track-by-artist.mjs`:
- Line 15: Update the component metadata in new-track-by-artist.mjs so the
description follows the required agent-friendly source-description structure and
ends with the exact documentation link format `[See the
documentation](https://...)`. Replace the current trailing `[see docs
here](...)` text in the description field, and make sure the final description
is more informative for agents while keeping the required link at the end.
- Around line 54-55: The new-track-by-artist source is accessing persisted state
from run() directly through this.db, which should be hidden behind private state
helpers. Move the lastCheckedAt and albumTrackCounts reads/writes in
NewTrackByArtistSource into private _get...() / _set...() methods, and update
run() and any related handlers to use those helpers so state access follows the
source convention.
In `@components/spotify/spotify.app.mjs`:
- Around line 444-456: The getAllTracksByAlbumIds flow only reads the first page
from each album returned by the /albums request, so tracks beyond that page are
lost. Update the album-track aggregation logic in getAllTracksByAlbumIds to
paginate each album’s tracks using the album tracks endpoint before pushing into
tracks, ensuring all pages are fetched before flattening. Keep the fix localized
around the existing /albums fetch and album.tracks.items handling so the
downstream Get All Tracks by Artist and New Track by Artist paths receive
complete results.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 60b21178-205a-4455-82a4-f73af61a46a2
📒 Files selected for processing (26)
components/spotify/actions/add-items-to-playlist/add-items-to-playlist.mjscomponents/spotify/actions/create-playlist/create-playlist.mjscomponents/spotify/actions/get-album-tracks/get-album-tracks.mjscomponents/spotify/actions/get-all-tracks-by-artist/get-all-tracks-by-artist.mjscomponents/spotify/actions/get-artist-top-tracks/get-artist-top-tracks.mjscomponents/spotify/actions/get-audio-features-for-a-track/get-audio-features-for-a-track.mjscomponents/spotify/actions/get-categorys-playlist/get-categorys-playlist.mjscomponents/spotify/actions/get-currently-playing-track/get-currently-playing-track.mjscomponents/spotify/actions/get-playlist-items/get-playlist-items.mjscomponents/spotify/actions/get-playlist/get-playlist.mjscomponents/spotify/actions/get-recommendations/get-recommendations.mjscomponents/spotify/actions/get-track/get-track.mjscomponents/spotify/actions/list-category-id-options/list-category-id-options.mjscomponents/spotify/actions/list-genres-options/list-genres-options.mjscomponents/spotify/actions/list-playlist-id-options/list-playlist-id-options.mjscomponents/spotify/actions/list-saved-user-tracks-id-options/list-saved-user-tracks-id-options.mjscomponents/spotify/actions/remove-items-from-playlist/remove-items-from-playlist.mjscomponents/spotify/actions/remove-user-saved-tracks/remove-user-saved-tracks.mjscomponents/spotify/actions/save-track/save-track.mjscomponents/spotify/actions/search/search.mjscomponents/spotify/package.jsoncomponents/spotify/sources/new-playlist/new-playlist.mjscomponents/spotify/sources/new-saved-track/new-saved-track.mjscomponents/spotify/sources/new-track-by-artist/new-track-by-artist.mjscomponents/spotify/sources/new-track-in-playlist/new-track-in-playlist.mjscomponents/spotify/spotify.app.mjs
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/spotify/spotify.app.mjs`:
- Around line 454-462: Guard the album iteration in spotify.app.mjs so null
placeholders from data.albums are skipped before calling getAlbumTracks().
Update the loop in the album-tracks fetch logic to check each album entry and
continue past null/undefined values, preserving the rest of the tracks
collection even when one album is unavailable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2e3a88e9-8dd4-487e-94dc-8fa0c759a6db
📒 Files selected for processing (2)
components/spotify/sources/new-track-by-artist/new-track-by-artist.mjscomponents/spotify/spotify.app.mjs
michelle0927
left a comment
There was a problem hiding this comment.
LGTM! Ready for QA.
Reworked the
new-track-by-artisttrigger so that it no longer fetches tracks for albums that had no change in the number of tracks, on every single run. It still does this once a day as a fallback, in case an album had changes without changing the amount of tracks (rare).Albums that had the amount of tracks change since the last run always immediately retrieve the tracks.
Also adjusted the app-wide retry logic to use delays of 5-10-15 seconds for the 1st/2nd/3rd retry, respectively (previously it was 0-5-10 seconds, likely due to an oversight)
Summary by CodeRabbit