From a091c6dbfc3e987da6f52c6b9fd1b936c9e99c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 24 Sep 2026 15:26:15 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(audio):=20the=20reason's=20?= =?UTF-8?q?writer=20is=20the=20engine=20lane,=20not=20this=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documents said the engine sets `audio_disabled_reason` on a death and clears it on its re-arm. In this tree nothing assigns that field off the death path: the only mid-session writer is `arm_audio` (`crates/engine/src/playback.rs:2687`), which assigns only when `open_audio` returned a device, so it can only clear. The app side is the *reader* of whatever reason the engine reports, and it never spells the engine's words -- a death that sets nothing stays unsaid, and that is the engine lane's half of this defect. --- crates/app/src/notices.rs | 15 ++++++++++----- crates/app/src/tests/media.rs | 11 +++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/crates/app/src/notices.rs b/crates/app/src/notices.rs index ca1a58c..d29702a 100644 --- a/crates/app/src/notices.rs +++ b/crates/app/src/notices.rs @@ -109,11 +109,16 @@ pub(crate) fn audio_step( } /// What a *change* in the engine's sound reason does to the notice queue, as a -/// pure step: the death line pushed when a reason arrives, the same line taken -/// back when the reason clears ([`PlaybackSession::audio_disabled_reason`]'s -/// `AUDIO_LOST` and its own re-arm). [`Player::watch_audio`] is the only caller -/// and owns the caching; this owns the queue, so a test can drive both -/// directions without a window and without a device that dies on cue. +/// pure step: the line pushed when a reason arrives, the same line taken back +/// when the reason clears. [`Player::watch_audio`] is the only caller and owns +/// the caching; this owns the queue, so a test can drive both directions without +/// a window and without a device that dies on cue. +/// +/// The reason itself is the engine's to write +/// ([`PlaybackSession::audio_disabled_reason`]): this side never spells its +/// words, so a lost-device reason the engine lane teaches the death path to set +/// needs nothing here -- and a death that sets nothing stays unsaid, which is +/// what the engine side of this defect is. pub(crate) fn audio_change_notice( notices: &mut std::collections::VecDeque, was: Option<&str>, diff --git a/crates/app/src/tests/media.rs b/crates/app/src/tests/media.rs index 01b34fc..8e8b810 100644 --- a/crates/app/src/tests/media.rs +++ b/crates/app/src/tests/media.rs @@ -16,12 +16,11 @@ use crate::ui::preview::{bgra_to_rgba, screenshot_path}; /// them (`notices` is a private module re-exported for the window). use crate::notices::{audio_change_notice, audio_lost_line, audio_tail}; -/// A sound device that dies under a file that is already open says so, and stops -/// saying so when the engine's own re-arm takes. The engine sets its -/// `audio_disabled_reason` to its lost-device word on a death and clears it on a -/// successful reopen, and nothing on this side ever looked at it: the two call -/// sites were the *open* paths, so a mid-session death played on in silence with -/// no message at all. +/// A reason that changes under a session that is already open says so, and stops +/// saying so when it clears. This side is the *reader*: the writer of a reason is +/// the engine's own `audio_disabled_reason`, and the app's two call sites were +/// the *open* paths -- so a reason that arrived mid-session reached no consumer +/// at all and the window played on in silence with nothing said. /// /// Driven through the queue step itself -- [`audio_change_notice`] is the whole /// of what a reason change does to the strip -- because a test cannot make a