diag(#1090/#1072): trace device-changed event into the frontend hang

The Rust reopen path returns cleanly (watcher keeps polling), so the UI
hang lives in the frontend after audio:device-changed. Log the emitted
payload (resumed null vs f64) and trace the bridge: event received → store
state → before/after playTrack. Last surviving line localises the hang.
TEMPORARY — revert before the real fix.
This commit is contained in:
Psychotoxical
2026-06-15 20:14:05 +02:00
parent da1ad78fbe
commit 9ead421451
2 changed files with 20 additions and 0 deletions
@@ -93,6 +93,15 @@ pub(crate) async fn reopen_output_stream(
// Falls back gracefully to the frontend path if conditions aren't met.
let resumed = try_resume_after_device_change(app, &snapshot).await;
// [DIAG #1090 — TEMPORARY] What does Rust hand to the frontend? resumed=true
// → null payload (frontend does nothing). resumed=false → f64 → frontend
// calls playTrack. This tells us which frontend branch the hang follows.
crate::app_eprintln!(
"[psysonic] DIAG-1090 reopen returning: resumed={resumed} was_playing={} payload={}",
snapshot.is_playing,
if resumed { "null".to_string() } else { format!("{:?}", snapshot.current_time_secs) }
);
match notify {
ReopenNotify::DeviceChanged => {
// null → Rust already resumed; frontend skips playTrack