Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when removing everything from the currently playing track to the end of the play queue while playing #270

Closed
dweymouth opened this issue Nov 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@dweymouth
Copy link
Owner

Repro:

  1. Queue some tracks and play one somewhere in the middle of the play queue
  2. Select everything from the currently playing track until the end of the queue and remove it
panic: runtime error: index out of range [-1]

goroutine 43 [running]:
github.com/dweymouth/supersonic/backend.(*PlaybackManager).NowPlaying(...)
	/Users/drew.weymouth/supersonic/backend/playbackmanager.go:127
github.com/dweymouth/supersonic/backend.(*PlaybackManager).invokeOnSongChangeCallbacks(0x14000374500)
	/Users/drew.weymouth/supersonic/backend/playbackmanager.go:397 +0x128
github.com/dweymouth/supersonic/backend.(*PlaybackManager).RemoveTracksFromQueue(0x14000374500, {0x1400688f4a0, 0x6, 0x6})
	/Users/drew.weymouth/supersonic/backend/playbackmanager.go:297 +0x320
github.com/dweymouth/supersonic/ui/browsing.(*NowPlayingPage).onRemoveSelectedFromQueue(0x14005508000)
	/Users/drew.weymouth/supersonic/ui/browsing/nowplayingpage.go:196 +0x50
fyne.io/fyne/v2/widget.(*menuItem).trigger(0x1400483e960)
	/Users/drew.weymouth/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20231103053003-b6f79d3c81cd/widget/menu_item.go:207 +0x40
fyne.io/fyne/v2/widget.(*menuItem).Tapped(0x1400483e901?, 0x1400045c09c?)
	/Users/drew.weymouth/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20231103053003-b6f79d3c81cd/widget/menu_item.go:153 +0x60
fyne.io/fyne/v2/internal/driver/glfw.(*window).mouseClickedHandleTapDoubleTap.func1()
	/Users/drew.weymouth/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20231103053003-b6f79d3c81cd/internal/driver/glfw/window.go:649 +0x2c
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0x0?)
	/Users/drew.weymouth/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20231103053003-b6f79d3c81cd/internal/driver/common/window.go:35 +0x3c
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
	/Users/drew.weymouth/go/pkg/mod/github.com/dweymouth/fyne/v2@v2.3.0-rc1.0.20231103053003-b6f79d3c81cd/internal/driver/glfw/window.go:959 +0x144
@dweymouth dweymouth added the bug Something isn't working label Nov 4, 2023
adamantike added a commit to adamantike/supersonic that referenced this issue Nov 5, 2023
Steps to reproduce:

1. Put multiple tracks in the queue (visible in the "Now Playing" panel).
2. Start reproducing **any** track in the queue.
3. Select tracks from the one being reproduced until the end of the
   queue (this was also reproducible when the last track is playing, and
   only that one is selected in this step).
4. Select the "Remove from queue" option.

Expected:

1. Selected tracks are removed from the queue.
2. Player is now in Stopped state.
3. If there are more tracks in the queue (not all of them were selected
   to be removed in step 3), then clicking on the "Play" button starts
   reproducing the queue from the beginning.

Actual:

Currently, the app crashes when step 4 is applied.

Fixes dweymouth#270.
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 a pull request may close this issue.

1 participant