Off-by-one error when using "play next" action

Open
#526 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #527 by @EthanJoyce — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile

Research direction

Start by reading the queue handling code for the “Play next” action and how it adjusts the insertion position when the selected song is before the currently playing song. Reproduce the three song scenario from the issue and check the resulting queue order. Done means the selected song is immediately after the currently playing song; issue #527 is a closed, unmerged pull request linked to this report.

Written by the indexing model from the issue text.

Description

bug needs triage
Checklist
  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.
Affected app version

1.8.5

Affected Android/Custom ROM version

GrapheneOS (2026110701; Android 17), Pixel Emulator (BE4B.251210.005; Android 16)

Affected device model

Pixel 8 Pro, Pixel Emulator

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug
  1. Have a library of at least three different songs
  2. Start playing a song, open track queue, arrange songs such that the currently playing song is in the middle (see screenshot 1 below)
  3. Return to library view, select song that's before the currently playing song, and select the "Play next" action
  4. The selected song is now after the next song, rather than taking the place of the next song (see screenshot 2)

Screenshot 1:
ignoreImageMinify

Screenshot 2:
ignoreImageMinify

Expected behavior

The song should be next in the track queue

Actual behavior

It is instead second-next (i.e. there's an off-by-one error in the queuing logic)

Screenshots/Screen recordings

No response

Additional information

No response

Dominant language
Kotlin
Stars
933
Forks
104
Avg merge
2d 10h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FossifyOrg/Music-Player

All issues in FossifyOrg/Music-Player

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.