fix(qconnect): announce the persisted device name when the socket reconnects

The initial connect threaded the custom device name into the join payload, but
the in-loop reconnect passed None on both hosts, so the rejoin announced the
default "Qbz - {hostname}" while the local identity kept resolving the saved
name. One device_uuid with two friendly names breaks the renderer self-match
when ADD_RENDERER omits the uuid, and the renderer then goes mute.

The reconnect now reads the same persisted name the local identity, the
deferred renderer join and the LAN projection already use. Nothing else in the
reconnect lane changes: no order, timing, backoff, join reason or rejoin
difference. A debug line records the announced name.

Verified by smoke test: a real WebSocket drop rejoined announcing the custom
name, and the iOS client kept both the name and control.

cc
This commit is contained in:
vicrodh committed 2026-09-15 18:18:41 -06:00
1 parent 43d8b56cf7
commit 01a9c612e8
3 files changed
+13 -5

No files matched your search

+5 -1
View File
@@ -4663,8 +4663,12 @@ impl SessionLoopHost for QtSessionLoopHost {
log::warn!("[QConnect] reconnect credential refresh failed: {error}");
}
}
// Announce the same persisted name the local identity matches against;
// the default name would break the renderer self-match after reconnect.
let device_name = load_persisted_device_name();
log::info!("[QConnect] reconnect: announcing device name {device_name:?}");
if let Err(err) =
bootstrap_remote_presence(&self.app, None, &self.authority, self.stamp).await
bootstrap_remote_presence(&self.app, device_name, &self.authority, self.stamp).await
{
if !self.authority.is_current(self.stamp) {
return;
+7 -3
View File
@@ -36,8 +36,8 @@ use super::engine::VolumeMode; // T10 (OD4): join-time volume report honors the
use super::lan::DaemonLanProjectionSlot;
use super::sink::{DaemonEventSink, DaemonQconnectApp};
use super::transport::{
default_qconnect_device_info, default_qconnect_device_info_with_name, resolve_transport_config,
QconnectJoinSessionRequest, AUDIO_QUALITY_HIRES_LEVEL2,
default_qconnect_device_info, default_qconnect_device_info_with_name, load_persisted_device_name,
resolve_transport_config, QconnectJoinSessionRequest, AUDIO_QUALITY_HIRES_LEVEL2,
};
use super::{update_lifecycle_state_if_running, DaemonQconnectInner};
use crate::adapter::DaemonAdapter;
@@ -151,8 +151,12 @@ impl SessionLoopHost for DaemonSessionLoopHost {
if !self.authority.is_current(self.stamp) {
return;
}
// Announce the same persisted name the local identity matches against;
// the default name would break the renderer self-match after reconnect.
let device_name = load_persisted_device_name();
log::info!("[QConnect] reconnect: announcing device name {device_name:?}");
if let Err(err) =
bootstrap_remote_presence(&self.app, None, &self.authority, self.stamp).await
bootstrap_remote_presence(&self.app, device_name, &self.authority, self.stamp).await
{
if !self.authority.is_current(self.stamp) {
return;
+1 -1
View File
@@ -316,7 +316,7 @@ pub fn build_set_position_player_state_request(
/// Load the persisted custom device name from the daemon-root settings DB.
/// Fail-open: None when `init_settings_db_path` never ran or on any read error.
fn load_persisted_device_name() -> Option<String> {
pub(crate) fn load_persisted_device_name() -> Option<String> {
qconnect_settings_db_path().and_then(|path| load_device_name_at(&path))
}