From 3a32863bc70392449eb10c649cc2917a2ff06ad0 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 13 Aug 2022 12:16:09 -0700 Subject: [PATCH] ipc: ensure backward compatibility of the protocol If the client was compiled with the previous version of the protocol, initialize StartSession.env with the default value instead of failing to deserialize the message. --- greetd_ipc/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/greetd_ipc/src/lib.rs b/greetd_ipc/src/lib.rs index 970e6e8..c20c00f 100644 --- a/greetd_ipc/src/lib.rs +++ b/greetd_ipc/src/lib.rs @@ -75,7 +75,11 @@ pub enum Request { /// Start a successfully logged in session. This will fail if the session /// has pending messages or has encountered an error. - StartSession { cmd: Vec, env: Vec }, + StartSession { + cmd: Vec, + #[serde(default)] + env: Vec, + }, /// Cancel a session. This can only be done if the session has not been /// started. Cancel does not have to be called if an error has been