mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1551] session_disconnect event fails to fire with librespot 0.7.0 #702
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#702
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @samcook on GitHub (Aug 24, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1551
Description
Thanks for the quick turnaround on #1547 / #1548.
I built a version of librespot from the current head of the
devbranch (d073cb1), and thesession_connectedevent is now firing when I establish a Spotify Connect session from my phone, butsession_disconnectedstill fails to fire, and librespot continues to play music until the end of the track.Version
librespot 0.7.0
d073cb1(Built on 2025-08-24, Build ID: 2TzDyiBU, Profile: release)How to reproduce
librespotwith an event handler script configured.session_connectedevent fires, executing script which logs the event and turns on AV receiver. 🎉session_disconnectedevent to fire, executing script which logs the event and turns off AV receiver.Log
Non-verbose log here. "Event fired" logs are output by my event handler script. Please let me know if you want a verbose log.
Host (what you are running
librespoton):@photovoltex commented on GitHub (Aug 25, 2025):
I ran into that problem during development... And I had it fixed but seem to have broken it during cleaning up the code and forgot to test it again because I was in a hurry. Classic mistake while fixing bugs.
Ah, and it's because the headers are overwritten when headers are given as parameters, which they are for the disconnect method.
@roderickvd commented on GitHub (Aug 25, 2025):
It happens 😆
We can roll out a v0.7.1 bug fix release in the weekend.
@photovoltex commented on GitHub (Aug 25, 2025):
Good to here, what a silly mistake. I already have created the PR for it^^;
@roderickvd commented on GitHub (Aug 25, 2025):
Please confirm that #1552 is working so we can schedule it for a quick v0.7.1 release.
@samcook commented on GitHub (Aug 25, 2025):
I've built and run that PR and I can confirm that disconnecting the session appears to be working for me now - music stops playing immediately, and the event fires as expected.
There are still warnings about context not being available, not sure if they're anything to worry about or not?
@samcook commented on GitHub (Aug 26, 2025):
Just as a follow up to this, I don't know if it's related or not...
A couple of hours after I disconnected the session from the previous comment I attempted to establish a new Spotify Connect session. On my Android phone, the session was sitting "connecting" for almost a minute (during which time I killed the Spotify app on the phone, reopened it, and tried to establish the Spotify Connect session again). Eventually after about a minute it connected, fired the event switching on my AV receiver, and started playing music.
Here are the logs from that (the first 4 lines below are the last 4 lines from the previous comment, so nothing else happened in between):
@photovoltex commented on GitHub (Aug 26, 2025):
That's a very good hint. That you even have to option to reconnect is probably only because both devices are in the same network, otherwise the device will not appear anymore. That's because of a misplaced method invocation that removes the connect state on disconnect.
@samcook commented on GitHub (Aug 26, 2025):
Made a build with #1552 and #1555 combined, and it appears to be behaving itself for me now 🙏