Prototype cursor sharing (the inefficient way)

I think this will be a key user experience driver, but we do need to
find a way to enable it without widening our vector clocks.
This commit is contained in:
Conrad Irwin 2024-01-08 22:32:12 -07:00
parent ca0c06b577
commit 82f7dd9bbb
2 changed files with 19 additions and 4 deletions

View file

@ -1814,11 +1814,24 @@ async fn update_buffer(
let mut guest_connection_ids;
let mut host_connection_id = None;
let mut requires_write_permission = false;
for op in request.operations.iter() {
match op.variant {
None | Some(proto::operation::Variant::UpdateSelections(_)) => {}
Some(_) => requires_write_permission = true,
}
}
{
let collaborators = session
.db()
.await
.project_collaborators_for_buffer_update(project_id, session.connection_id)
.project_collaborators_for_buffer_update(
project_id,
session.connection_id,
requires_write_permission,
)
.await?;
guest_connection_ids = Vec::with_capacity(collaborators.len() - 1);
for collaborator in collaborators.iter() {