Skip to content

Commit 4b9d4b2

Browse files
committed
Added HELLO negotiation
1 parent 8aa8f6e commit 4b9d4b2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

RFCs/0002-pluggable-discovery.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ After startup, the tool will just stay idle waiting for commands. The available
5050

5151
#### HELLO command
5252

53-
`HELLO` is the **first command that must be sent** to the discovery to tell the name of the client and the version of the pluggable discovery protocol that the client supports.
53+
`HELLO` is the **first command that must be sent** to the discovery to tell the name of the client/IDE and the version of the pluggable discovery protocol that the client/IDE supports.
5454
The syntax of the command is:
5555

5656
`HELLO <PROTOCOL_VERSION> "<USER_AGENT>"`
5757

58-
- `<PROTOCOL_VERSION>` is the protocol version (currently `1.0.0`)
58+
- `<PROTOCOL_VERSION>` is the maximum protocol version supported by the client/IDE (currently `1.0.0`)
5959

6060
- `<USER_AGENT>` is the name and version of the client (double-quotes `"` are not allowed)
6161

@@ -70,10 +70,17 @@ the response to the command is:
7070
```JSON
7171
{
7272
"eventType": "hello",
73+
"protocolVersion": "1.0.0",
7374
"message": "OK"
7475
}
7576
```
7677

78+
The `protocolVersion` field represents the protocol version that will be used in the rest of the communication. There are three possible cases:
79+
80+
- if the client/IDE supports the same or a more recent version of the protocol than the discovery, then the IDE should go into a compatibility mode and use the protocol level supported by the discovery.
81+
- if the discovery supports a more recent version of the protocol than the client/IDE: the discovery should downgrade itself into compatibility mode and report a `protocolVersion` that is less than or equal to the one supported by the client/IDE.
82+
- if the discovery cannot go into compatibility mode, it will report the protocol version supported (even if greater than the version supported by the client/IDE) and the client/IDE may decide to terminate the discovery or produce an error/warning.
83+
7784
#### START command
7885

7986
The `START` command initializes and start the discovery internal subroutines. This command must be called before `LIST` or `START_SYNC`. The response to the start command is:

0 commit comments

Comments
 (0)