-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Currently, when the Daemon receives a UiStartOrder message, it checks to see if the Node is running. If it isn't, the Daemon starts it and returns a UiStartResponse message containing the Node's process ID and port. But if the Node is already running, the Daemon returns an error that contains nothing but an error code and a message.
This error is not helpful for a UI that wants to connect to an already-running Node.
Ultimate Intended Situation: We want the Daemon to stop responding with an error when the Node is already running. Here's what the UiStartResponse message looks like now--the message that the Daemon sends when the Node was not running and has just been started up:
pub struct UiStartResponse {
#[serde(rename = "newProcessId")]
pub new_process_id: u32,
#[serde(rename = "redirectUiPort")]
pub redirect_ui_port: u16,
}
We'd like the Daemon to send a message that looks like the following, whether the Node has just been started up or whether it was already started and running:
pub struct UiStartResponseV2 {
#[serde(rename = "wasRunning")]
pub was_running: bool,
#[serde(rename = "processId")]
pub process_id: u32,
#[serde(rename = "uiPort")]
pub ui_port: u16,
}
Actual errors, of course, should still result in error responses; but sending a message like this when the Node is already running will provide the information necessary to connect to it.
Big Problem:
At the moment, all the user interfaces are expecting a UiStartResponse, not a UiStartResponseV2. If we stop sending the former and instead send the latter, they'll all break.
Audacious Solution:
Therefore: initially, let's send both UiStartResponse and UiStartResponseV2 in response to a UiStartOrder message. Whichever the UI isn't expecting should be ignored, perhaps with a warning message, and everything ought to work fine. Once all the UIs are expecting UiStartResponseV2, we can stop sending the UiStartResponse, and stop getting warning messages.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status