Skip to content

Commit da5070c

Browse files
committed
fix: propagate recording session to screencast stream
After `record start`, the active page switches to the new recording context but `update_stream_client()` is never called. This causes the live preview (screencast) to stay on the old pre-recording context while CLI commands execute on the new recording context. The same issue affects `record stop` — the screencast doesn't sync back to the current active page. Fix: call `state.update_stream_client().await` in both `handle_recording_start` and `handle_recording_stop`, matching the pattern used by all other commands that switch contexts (open, close, connect, tab switch, etc.). This is the same class of bug as #1019 (downloads not working in recording context) — state that needs to be propagated to the new recording context.
1 parent a95bc0f commit da5070c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cli/src/native/actions.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,6 +3711,11 @@ async fn handle_recording_start(cmd: &Value, state: &mut DaemonState) -> Result<
37113711
server.set_recording(true, &state.engine).await;
37123712
}
37133713

3714+
// Propagate the new recording session to the screencast stream.
3715+
// Without this, the live preview stays on the old (pre-recording) context
3716+
// while CLI commands execute on the new recording context.
3717+
state.update_stream_client().await;
3718+
37143719
Ok(result)
37153720
}
37163721

@@ -3722,6 +3727,10 @@ async fn handle_recording_stop(state: &mut DaemonState) -> Result<Value, String>
37223727
server.set_recording(false, &state.engine).await;
37233728
}
37243729

3730+
// Sync the screencast stream back to the current active page
3731+
// (which may have changed during recording).
3732+
state.update_stream_client().await;
3733+
37253734
result
37263735
}
37273736

0 commit comments

Comments
 (0)