Skip to content

Commit 232e43e

Browse files
jmoseleyCopilot
andcommitted
Assert canvasProvider.name key is absent, not just null
Indexing with ["name"] returns Value::Null both when the key is absent and when it is present as null. Since the wire contract omits name when None, assert the key is not present to catch a regression that would serialize name: null. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent f10d05a commit 232e43e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rust/tests/session_test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2950,7 +2950,10 @@ async fn resume_session_sends_canvas_fields_and_captures_open_canvases() {
29502950
request["params"]["canvasProvider"]["id"],
29512951
"app:builtin:window-1"
29522952
);
2953-
assert!(request["params"]["canvasProvider"]["name"].is_null());
2953+
assert!(
2954+
request["params"]["canvasProvider"].get("name").is_none(),
2955+
"name should be omitted from the wire when None, not serialized as null"
2956+
);
29542957
assert_eq!(
29552958
request["params"]["openCanvases"][0]["instanceId"],
29562959
"counter-1"

0 commit comments

Comments
 (0)