Switch to a new flow for advertising, sharing and joining worktrees
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.
This commit is contained in:
+18
-6
@@ -35,6 +35,9 @@ message Envelope {
|
||||
ChannelMessageSent channel_message_sent = 30;
|
||||
GetChannelMessages get_channel_messages = 31;
|
||||
GetChannelMessagesResponse get_channel_messages_response = 32;
|
||||
OpenWorktree open_worktree = 33;
|
||||
OpenWorktreeResponse open_worktree_response = 34;
|
||||
UnshareWorktree unshare_worktree = 35;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,22 +51,30 @@ message Error {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message OpenWorktree {
|
||||
string root_name = 1;
|
||||
repeated string collaborator_logins = 2;
|
||||
}
|
||||
|
||||
message OpenWorktreeResponse {
|
||||
uint64 worktree_id = 1;
|
||||
}
|
||||
|
||||
message ShareWorktree {
|
||||
Worktree worktree = 1;
|
||||
}
|
||||
|
||||
message ShareWorktreeResponse {
|
||||
message ShareWorktreeResponse {}
|
||||
|
||||
message UnshareWorktree {
|
||||
uint64 worktree_id = 1;
|
||||
string access_token = 2;
|
||||
}
|
||||
|
||||
message JoinWorktree {
|
||||
uint64 worktree_id = 1;
|
||||
string access_token = 2;
|
||||
}
|
||||
|
||||
message JoinWorktreeResponse {
|
||||
uint64 worktree_id = 1;
|
||||
Worktree worktree = 2;
|
||||
uint32 replica_id = 3;
|
||||
repeated Peer peers = 4;
|
||||
@@ -187,8 +198,9 @@ message User {
|
||||
}
|
||||
|
||||
message Worktree {
|
||||
string root_name = 1;
|
||||
repeated Entry entries = 2;
|
||||
uint64 id = 1;
|
||||
string root_name = 2;
|
||||
repeated Entry entries = 3;
|
||||
}
|
||||
|
||||
message Entry {
|
||||
|
||||
+8
-2
@@ -135,11 +135,13 @@ messages!(
|
||||
GetUsersResponse,
|
||||
JoinChannel,
|
||||
JoinChannelResponse,
|
||||
JoinWorktree,
|
||||
JoinWorktreeResponse,
|
||||
LeaveChannel,
|
||||
OpenBuffer,
|
||||
OpenBufferResponse,
|
||||
JoinWorktree,
|
||||
JoinWorktreeResponse,
|
||||
OpenWorktree,
|
||||
OpenWorktreeResponse,
|
||||
Ping,
|
||||
RemovePeer,
|
||||
SaveBuffer,
|
||||
@@ -147,6 +149,7 @@ messages!(
|
||||
SendChannelMessageResponse,
|
||||
ShareWorktree,
|
||||
ShareWorktreeResponse,
|
||||
UnshareWorktree,
|
||||
UpdateBuffer,
|
||||
UpdateWorktree,
|
||||
);
|
||||
@@ -157,10 +160,12 @@ request_messages!(
|
||||
(JoinChannel, JoinChannelResponse),
|
||||
(OpenBuffer, OpenBufferResponse),
|
||||
(JoinWorktree, JoinWorktreeResponse),
|
||||
(OpenWorktree, OpenWorktreeResponse),
|
||||
(Ping, Ack),
|
||||
(SaveBuffer, BufferSaved),
|
||||
(UpdateBuffer, Ack),
|
||||
(ShareWorktree, ShareWorktreeResponse),
|
||||
(UnshareWorktree, Ack),
|
||||
(SendChannelMessage, SendChannelMessageResponse),
|
||||
(GetChannelMessages, GetChannelMessagesResponse),
|
||||
);
|
||||
@@ -175,6 +180,7 @@ entity_messages!(
|
||||
JoinWorktree,
|
||||
RemovePeer,
|
||||
SaveBuffer,
|
||||
UnshareWorktree,
|
||||
UpdateBuffer,
|
||||
UpdateWorktree,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user