chore(qconnect): log the cursor ids every renderer report carries
Three separate hunts this session ended at the same blind spot: the periodic report never printed the ids it announces, and a peer renderer's echo printed none of the cursor it reports. Both are what a controller builds its row selection from, so a wrong or missing id there looks like "the controller ignores us" with nothing in the log to say why. Allowlisted scalars only, at debug, following the rule already written for loop_mode: the payloads themselves stay unlogged because they can carry session and delegated-credential material. cc
This commit is contained in:
2 files changed
+27
-1
No files matched your search
@@ -699,7 +699,25 @@ impl QconnectEventSink for QtQconnectEventSink {
|
||||
// payload is intentionally never logged: it can carry session and
|
||||
// delegated-credential material.
|
||||
if message_type == "MESSAGE_TYPE_SRVR_CTRL_RENDERER_STATE_UPDATED" {
|
||||
log::debug!("[QConnect] Session management: {message_type}");
|
||||
// Allowlisted scalars ONLY, same rule as loop_mode below:
|
||||
// never the payload. They are what a peer renderer — the
|
||||
// official web/desktop client included — announces about
|
||||
// its cursor, which is the contract QBZ is compared against
|
||||
// at the end of the queue.
|
||||
let player_state = payload.get("player_state");
|
||||
let scalar = |field: &str| {
|
||||
player_state
|
||||
.and_then(|value| value.get(field))
|
||||
.and_then(Value::as_i64)
|
||||
};
|
||||
log::debug!(
|
||||
"[QConnect] Session management: {message_type} renderer={:?} current_qid={:?} next_qid={:?} playing={:?} pos={:?}",
|
||||
payload.get("renderer_id").and_then(Value::as_i64),
|
||||
scalar("current_queue_item_id"),
|
||||
scalar("next_queue_item_id"),
|
||||
scalar("playing_state"),
|
||||
scalar("current_position"),
|
||||
);
|
||||
} else if message_type == "MESSAGE_TYPE_SRVR_CTRL_LOOP_MODE_SET" {
|
||||
// This allowlisted scalar makes an actual mode transition
|
||||
// break the consecutive-log run; never print the payload.
|
||||
|
||||
@@ -1972,6 +1972,14 @@ impl QtQconnectService {
|
||||
}
|
||||
}
|
||||
|
||||
// What the controller's row selection is built from. Without it the
|
||||
// periodic report is the only one whose ids never reach the log, and a
|
||||
// wrong id here reads on the controller as "already on that track".
|
||||
log::debug!(
|
||||
"[QConnect] periodic report: track={track_id} current_qid={current_qid:?} next_qid={next_qid:?} playing={playing_state} pos={position_ms} qv={}.{}",
|
||||
queue_version.major,
|
||||
queue_version.minor,
|
||||
);
|
||||
let report = build_renderer_playback_report(
|
||||
Uuid::new_v4().to_string(),
|
||||
queue_version,
|
||||
|
||||
Reference in new issue
Block a user