Skip to content

feat(music): autoplay default-on and cross-session deduplication - #526

Merged
LucasSantana-Dev merged 1 commit into
mainfrom
feat/autoplay-improvements
Apr 10, 2026
Merged

LucasSantana-Dev merged 1 commit into
mainfrom
feat/autoplay-improvements

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Apr 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Default autoplay to enabled when no guild settings exist (was silently defaulting to disabled, causing confusion for new guilds)
  • Deduplicate against persistent track history (last 20 tracks from DB) when replenishing queue, preventing recently-played songs from being re-suggested cross-session
  • Fix autoplay spec tests to reflect new default-on behavior
  • Add trackHistoryService mock to queueManipulation.spec.ts

Test plan

  • All 14 autoplay.spec.ts tests pass
  • All 37 queueManipulation.spec.ts tests pass
  • CI green

Summary by CodeRabbit

  • New Features

    • Enhanced automatic music queue refilling with improved duplicate prevention leveraging persistent track history for better filtering
  • Behavior Updates

    • Autoplay now defaults to enabled when no prior settings exist, providing a better first-time user experience

@vercel

vercel Bot commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Apr 10, 2026 5:42pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 10, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Updated autoplay command to default to enabled state when queue is null and settings are missing, and enhanced queue replenishment to filter duplicate candidates using persistent track history fetched from the track history service.

Changes

Cohort / File(s) Summary
Autoplay Command
packages/bot/src/functions/music/commands/autoplay.ts, packages/bot/src/functions/music/commands/autoplay.spec.ts
Changed resolveCurrentAutoplayState default return value from false to true when no guild settings exist. Updated test expectations to reflect that autoplay is now disabled by default (treating enabled as the fallback), and removed embed description assertion for the no-queue scenario.
Queue Manipulation
packages/bot/src/utils/music/queueManipulation.ts, packages/bot/src/utils/music/queueManipulation.spec.ts
Added persistent track history fetching via trackHistoryService.getTrackHistory(queue.guild.id, 20) in replenishQueue. Extended buildExcludedUrls and buildExcludedKeys helper functions with optional persistentHistory parameters to incorporate historical track data into duplicate candidate filtering. Updated test setup to mock and reset track history calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

size/m

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: enabling autoplay by default and implementing cross-session deduplication to avoid suggesting recently played tracks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/autoplay-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Default autoplay to enabled when no guild settings exist (was defaulting to disabled)
- Deduplicate against persistent track history (last 20 tracks) when replenishing queue
- Fix autoplay spec tests to reflect new default-on behavior
- Add trackHistoryService mock to queueManipulation spec
@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit 7835444 into main Apr 10, 2026
11 of 12 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the feat/autoplay-improvements branch April 10, 2026 17:45
LucasSantana-Dev added a commit that referenced this pull request Apr 10, 2026
Bump versions, update CHANGELOG and IMPLEMENTATION_STATUS to reflect
all features shipped in PRs #520–#526: music commands (playtop, playskip,
skipto, seek, replay, leavecleanup, nowplaying alias, effects, volume 1-200,
pause toggle, provider param), moderation (purge, lockdown, slowmode),
and management (autorole, giveaway, autoplay default-on + dedup).
@LucasSantana-Dev LucasSantana-Dev mentioned this pull request Apr 10, 2026
1 task
LucasSantana-Dev added a commit that referenced this pull request Apr 10, 2026
Bump versions, update CHANGELOG and IMPLEMENTATION_STATUS to reflect
all features shipped in PRs #520–#526: music commands (playtop, playskip,
skipto, seek, replay, leavecleanup, nowplaying alias, effects, volume 1-200,
pause toggle, provider param), moderation (purge, lockdown, slowmode),
and management (autorole, giveaway, autoplay default-on + dedup).
LucasSantana-Dev added a commit that referenced this pull request Apr 10, 2026
…aths (#528)

* chore(release): v2.6.71

Bump versions, update CHANGELOG and IMPLEMENTATION_STATUS to reflect
all features shipped in PRs #520–#526: music commands (playtop, playskip,
skipto, seek, replay, leavecleanup, nowplaying alias, effects, volume 1-200,
pause toggle, provider param), moderation (purge, lockdown, slowmode),
and management (autorole, giveaway, autoplay default-on + dedup).

* test(bot): add interactionReply assertions to session command error paths

- Add missing assertions for delete, restore, and connection error paths
- Verify ephemeral flag is set on error responses
- Catch false positives in session error handling
LucasSantana-Dev added a commit that referenced this pull request May 13, 2026
- Default autoplay to enabled when no guild settings exist (was defaulting to disabled)
- Deduplicate against persistent track history (last 20 tracks) when replenishing queue
- Fix autoplay spec tests to reflect new default-on behavior
- Add trackHistoryService mock to queueManipulation spec
LucasSantana-Dev added a commit that referenced this pull request May 13, 2026
Bump versions, update CHANGELOG and IMPLEMENTATION_STATUS to reflect
all features shipped in PRs #520–#526: music commands (playtop, playskip,
skipto, seek, replay, leavecleanup, nowplaying alias, effects, volume 1-200,
pause toggle, provider param), moderation (purge, lockdown, slowmode),
and management (autorole, giveaway, autoplay default-on + dedup).
LucasSantana-Dev added a commit that referenced this pull request May 13, 2026
…aths (#528)

* chore(release): v2.6.71

Bump versions, update CHANGELOG and IMPLEMENTATION_STATUS to reflect
all features shipped in PRs #520–#526: music commands (playtop, playskip,
skipto, seek, replay, leavecleanup, nowplaying alias, effects, volume 1-200,
pause toggle, provider param), moderation (purge, lockdown, slowmode),
and management (autorole, giveaway, autoplay default-on + dedup).

* test(bot): add interactionReply assertions to session command error paths

- Add missing assertions for delete, restore, and connection error paths
- Verify ephemeral flag is set on error responses
- Catch false positives in session error handling

This branch was successfully deployed

1 active deployment
Preview — 4cb95b6d Deployed Apr 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant