mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #1129] [MERGED] add session timeout handling #1241
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#1241
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?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/1129
Author: @eladyn
Created: 3/17/2023
Status: ✅ Merged
Merged: 6/1/2023
Merged by: @roderickvd
Base:
dev← Head:session_timeout📝 Commits (8)
80711f9add session timeout handling2d575dbfix reconnection for invalid sessions9522f8fmove session timeout handling to Spirc3898d1amake time_delta computation safer077effedocs: recommend session_timeout for Sessione690b70implement session timeouts within the session316992bupdate changelog075c055fix clippy warnings📊 Changes
5 files changed (+64 additions, -22 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
core/src/mercury/mod.rs(+1 -2)📝
core/src/session.rs(+50 -9)📝
core/src/version.rs(+1 -1)📝
src/main.rs(+11 -10)📄 Description
See https://github.com/librespot-org/librespot/issues/1102#issuecomment-1398277032.
This makes sure that we receive a
pingat least every 2 minutes (which seems to happen consistently, when connected) and otherwise shuts down the session, since the connection stalled in this case. (inspired by thelibrespot-javaimplementation)In combination with the changes to
main.rs, this makes sure that librespot successfully reconnects.I tested this by suspending my laptop and waking it up several hours later. After less than 2 minutes, it noticed that the connection had stalled and restarted itself.
(Hopefully) Fixes #1102.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.