Skip to content

Commit 2783121

Browse files
committed
fix(ui): add rename_all_fields to HelixEvent so exit_code serializes as exitCode
Serde's rename_all on an enum only renames variant names (Output→output, Done→done), not fields inside struct variants. Without rename_all_fields, Done { exit_code } serializes as "exit_code" in JSON, but the frontend reads msg.data.exitCode — always undefined — making every command block show status "error" regardless of the real exit code. Fix: add rename_all_fields = "camelCase" at the container level (serde ≥1.0.185, we use 1.0.228) so exit_code → exitCode in the Done variant. https://claude.ai/code/session_01E7C1r4saaKwguu88r6sqt4
1 parent 995140b commit 2783121

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ui/src-tauri/src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tokio::io::{AsyncBufReadExt, BufReader};
55
use tokio::process::Command;
66

77
#[derive(Clone, Serialize)]
8-
#[serde(rename_all = "camelCase", tag = "event", content = "data")]
8+
#[serde(rename_all = "camelCase", rename_all_fields = "camelCase", tag = "event", content = "data")]
99
pub enum HelixEvent {
1010
Output { stream: String, line: String },
1111
Done { exit_code: i32 },

0 commit comments

Comments
 (0)