Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Deferred transport resume threads ignore pause intent and stack across rapid skips

Aperta
#448 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Start in src/core/app/transport.rs and trace previous_track, force_previous_track, next_track, pause_native_playback, and the native playback generation and pause-intent state. Reproduce the skip-then-pause case, then check how rapid skips affect delayed commands; the force path needs guards before both delayed prev() and play(). Done means deferred commands run only when their skip remains current and pause intent has not changed, verified with the full cargo run build and a manual smoke test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
The three native skip paths (previous_track, force_previous_track, next_track in src/core/app/transport.rs) spawn a detached thread that sleeps 300-500 ms and then issues activate()/play() (plus prev() in the force path) against the streaming player, to work around librespot occasionally landing paused after a skip. No thread checks native_is_playing, pause intent, or a generation value before firing, so:

  • Skip, then pause within the delay window: pause_native_playback records paused intent and pauses the player, and the thread then resumes playback anyway.
  • Rapid repeated skips stack multiple pending play()/prev() commands against a track that has already changed.

Surfaced by CodeRabbit on PR #446 (thread: https://github.com/LargeModGames/spotatui/pull/446#discussion_r3770140111). Deferred there because PR #446 is pure code movement and this touches the most regression-prone area of the codebase.

To Reproduce

  1. Play natively (spotatui as the Connect device)
  2. Press next-track, then pause within ~300 ms
  3. Playback resumes on its own when the deferred thread fires

Expected behavior
A deferred resume only lands if the skip it belongs to is still the current intent. Capture native_playback_generation (or introduce a dedicated counter) plus the pause intent before spawning, and have the thread re-check both before issuing commands. The force path needs the guard on both the delayed prev() and the delayed play().

Constraint from CLAUDE.md: native playback changes must be verified with the full cargo run build and a manual smoke test, not only the slim gate.

Desktop (please complete the following information):

  • OS: any
  • Terminal: any
  • Version: main (post PR #446)
Lingua principale
Rust
Stelle
1.4k
Fork
238
Merge medio
10h 34m
PR unite (30g)
194

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LargeModGames/spotatui

Tutte le issue di LargeModGames/spotatui

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.