fix: omit queue_item_ids from renderer state reports to fix seekbar sync

The server rejects renderer state reports with "Current track not found
in queue nor autoplay" after QBZ-initiated queue loads, because it assigns
non-standard queue_item_ids (first track = track_id, rest = 1..N).

Omit current_queue_item_id and next_queue_item_id from all outbound
renderer reports. The server already knows the current track from
SET_STATE commands and adds the correct queue_item_id when forwarding
to controllers.

Also add info-level diagnostic logging to both report paths (periodic
frontend reports and command-response reports) and the protobuf encoder
for verifying wire content.
This commit is contained in:
vicrodh committed 2026-02-22 15:18:35 -06:00
1 parent 155897a5b1
commit 40a2fa618e
4 files changed
+48 -10

No files matched your search

+17 -2
View File
@@ -1723,6 +1723,21 @@ pub async fn v2_qconnect_report_playback_state(
}
let queue_version = service.get_queue_version().await;
log::info!(
"[QConnect/Report] Periodic state report: playing={} pos={:?} dur={:?} qid={:?} next_qid={:?} track_id={:?} qv={}.{}",
playing_state, current_position, duration,
resolved_current_qid, resolved_next_qid, current_track_id,
queue_version.major, queue_version.minor
);
// NOTE: We intentionally OMIT current_queue_item_id and next_queue_item_id
// from periodic state reports. The server validates these IDs against its
// queue state and rejects reports when IDs don't match (returns "Current track
// not found in queue nor autoplay"). This happens consistently after QBZ-initiated
// queue loads where the server assigns non-standard queue_item_ids.
// The server already knows the current track from SET_STATE commands and adds
// the correct queue_item_id when forwarding to controllers.
let report = RendererReport::new(
RendererReportType::RndrSrvrStateUpdated,
Uuid::new_v4().to_string(),
@@ -1732,8 +1747,8 @@ pub async fn v2_qconnect_report_playback_state(
"buffer_state": BUFFER_STATE_OK,
"current_position": current_position,
"duration": duration,
"current_queue_item_id": resolved_current_qid,
"next_queue_item_id": resolved_next_qid,
"current_queue_item_id": null,
"next_queue_item_id": null,
"queue_version": {
"major": queue_version.major,
"minor": queue_version.minor