From 3d159c02541da62de054136bb723ef07b045efef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chaonan=E2=80=9D?= Date: Tue, 18 Aug 2026 15:28:08 +0800 Subject: [PATCH] test(protocol): align handshake fixtures with 1.0 floor and clarify v2/v3 naming --- .../extension/src/lib/__tests__/connection-controller.test.ts | 2 +- apps/extension/src/transport/types.ts | 4 +++- crates/bsk-cli/tests/browser_wait.rs | 2 +- crates/bsk-cli/tests/cancel_forwarding.rs | 2 +- crates/bsk-cli/tests/per_session_queue.rs | 2 +- crates/bsk-cli/tests/session_user_interrupt.rs | 2 +- crates/bsk-cli/tests/sessions_ipc.rs | 4 ++-- crates/bsk-cli/tests/tools_ipc.rs | 2 +- crates/bsk-cli/tests/tools_m7_ipc.rs | 2 +- crates/bsk-cli/tests/tools_m8_ipc.rs | 2 +- crates/bsk-cli/tests/tools_m9_ipc.rs | 2 +- crates/bsk-cli/tests/ws_handshake.rs | 2 +- 12 files changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/extension/src/lib/__tests__/connection-controller.test.ts b/apps/extension/src/lib/__tests__/connection-controller.test.ts index 53d34af..4494523 100644 --- a/apps/extension/src/lib/__tests__/connection-controller.test.ts +++ b/apps/extension/src/lib/__tests__/connection-controller.test.ts @@ -26,7 +26,7 @@ function handshake( } describe("computeConnectedState (protocol-based compat)", () => { - it("returns connected when protocol strings match", () => { + it("returns connected when daemon protocol equals extension protocol", () => { expect(computeConnectedState(handshake("1.1", "1.0"), MIN_COMPATIBLE_PROTOCOL)).toEqual({ kind: "connected", }); diff --git a/apps/extension/src/transport/types.ts b/apps/extension/src/transport/types.ts index 7d87667..e430a8e 100644 --- a/apps/extension/src/transport/types.ts +++ b/apps/extension/src/transport/types.ts @@ -657,7 +657,9 @@ export interface EmulateResult { } // -------------------------------------------------------------------------- -// Semantic record payloads — mirror bsk-protocol record.rs +// Semantic record payloads — legacy Trace v2 shapes (`Trace`/`Step`) mirror +// bsk-protocol record_v2.rs; Trace v3 shapes (`TraceV3`/`StepV3`) mirror +// record.rs (note: in Rust, `Trace` is the v3 shape). // -------------------------------------------------------------------------- export const TRACE_VERSION = 3; diff --git a/crates/bsk-cli/tests/browser_wait.rs b/crates/bsk-cli/tests/browser_wait.rs index 26f7620..b2a9a14 100644 --- a/crates/bsk-cli/tests/browser_wait.rs +++ b/crates/bsk-cli/tests/browser_wait.rs @@ -119,7 +119,7 @@ async fn handshake_as_ext( version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { diff --git a/crates/bsk-cli/tests/cancel_forwarding.rs b/crates/bsk-cli/tests/cancel_forwarding.rs index 1abd8f9..01894c8 100644 --- a/crates/bsk-cli/tests/cancel_forwarding.rs +++ b/crates/bsk-cli/tests/cancel_forwarding.rs @@ -83,7 +83,7 @@ async fn handshake_as_ext( }, label: "Test".into(), min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), }; let req = RequestFrame { id: "hs".into(), diff --git a/crates/bsk-cli/tests/per_session_queue.rs b/crates/bsk-cli/tests/per_session_queue.rs index c1baa74..8f0bdf6 100644 --- a/crates/bsk-cli/tests/per_session_queue.rs +++ b/crates/bsk-cli/tests/per_session_queue.rs @@ -88,7 +88,7 @@ async fn handshake_as_ext( version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { diff --git a/crates/bsk-cli/tests/session_user_interrupt.rs b/crates/bsk-cli/tests/session_user_interrupt.rs index 7529273..4ae1ce4 100644 --- a/crates/bsk-cli/tests/session_user_interrupt.rs +++ b/crates/bsk-cli/tests/session_user_interrupt.rs @@ -89,7 +89,7 @@ async fn handshake_as_ext( }, label: "Test".into(), min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), }; let req = RequestFrame { id: "hs".into(), diff --git a/crates/bsk-cli/tests/sessions_ipc.rs b/crates/bsk-cli/tests/sessions_ipc.rs index 9411b00..4d55b06 100644 --- a/crates/bsk-cli/tests/sessions_ipc.rs +++ b/crates/bsk-cli/tests/sessions_ipc.rs @@ -93,7 +93,7 @@ async fn handshake_as_ext(ws: &mut TestWs) -> HandshakeResult { version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { @@ -765,7 +765,7 @@ async fn connect_second_ext( version: "130".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: label.into(), }; let hs = RequestFrame { diff --git a/crates/bsk-cli/tests/tools_ipc.rs b/crates/bsk-cli/tests/tools_ipc.rs index 97fa635..b64ff9b 100644 --- a/crates/bsk-cli/tests/tools_ipc.rs +++ b/crates/bsk-cli/tests/tools_ipc.rs @@ -80,7 +80,7 @@ async fn do_handshake(ws: &mut Ws) -> HandshakeResult { version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { diff --git a/crates/bsk-cli/tests/tools_m7_ipc.rs b/crates/bsk-cli/tests/tools_m7_ipc.rs index 095584a..4635828 100644 --- a/crates/bsk-cli/tests/tools_m7_ipc.rs +++ b/crates/bsk-cli/tests/tools_m7_ipc.rs @@ -83,7 +83,7 @@ async fn do_handshake(ws: &mut Ws) -> HandshakeResult { version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { diff --git a/crates/bsk-cli/tests/tools_m8_ipc.rs b/crates/bsk-cli/tests/tools_m8_ipc.rs index 4bdce78..777d212 100644 --- a/crates/bsk-cli/tests/tools_m8_ipc.rs +++ b/crates/bsk-cli/tests/tools_m8_ipc.rs @@ -82,7 +82,7 @@ async fn do_handshake(ws: &mut Ws) -> HandshakeResult { version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { diff --git a/crates/bsk-cli/tests/tools_m9_ipc.rs b/crates/bsk-cli/tests/tools_m9_ipc.rs index 7937c27..f5015ca 100644 --- a/crates/bsk-cli/tests/tools_m9_ipc.rs +++ b/crates/bsk-cli/tests/tools_m9_ipc.rs @@ -92,7 +92,7 @@ async fn do_handshake(ws: &mut Ws) -> HandshakeResult { version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test".into(), }; let req = RequestFrame { diff --git a/crates/bsk-cli/tests/ws_handshake.rs b/crates/bsk-cli/tests/ws_handshake.rs index 300a8f0..be413d2 100644 --- a/crates/bsk-cli/tests/ws_handshake.rs +++ b/crates/bsk-cli/tests/ws_handshake.rs @@ -60,7 +60,7 @@ pub async fn send_handshake( version: "131.0".into(), }, min_compatible_peer: Some("0.1.0-dev.0".parse().unwrap()), - min_compatible_protocol: Some("1.1".into()), + min_compatible_protocol: Some("1.0".into()), label: "Test Chrome".into(), }; let req = RequestFrame {