When closing a connection (either due to an error or simply because the
user wanted to), we will now *take* `response_channels` as opposed to
clearing them. This ensures that `Peer::request` can't succeed in both
adding the oneshot channel in `response_channels` map _and_ submit the
message onto the `outgoing_tx` channel.
This also streamlines how we close a connection by unifying all the exit
code paths of the IO handling future.
Now, when you open a local worktree, we immediately send an `OpenWorktree` message
to the server, telling it the name of the folder that you've opened, and the names of all the
collaborators (based on a `.zed.toml` file). The server responds with a unique id for the
worktree.
When starting share this local worktree, you now include this previously-assigned id
in the `ShareWorktree` message.
When joining a worktree, there is no longer a need to provide an access token. The access
is controlled by the set of "collaborator logins" that were provided when the worktree
was initially opened by the host.
Still need to actually handle an HTTP response from the server indicating there was an invalid token.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This is mostly to set us up to test the rpc::Client's reconnect
logic.
There are multiple ways that the `rpc::Client` may establish
its websocket connection: (SSL in production, plain TCP during
local development, and using an in-memory connection for tests).
Now we can represent all of those connections using a common type.
Also, several long methods no longer need to be generic, which
is good for compile time.
This required a rework of the macro so that we can always construct a typed envelope from our list of available message types from incoming protobuf envelopes.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>