Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Tolerate channel buffer operations being re-sent

Max Brunsfeld58f58a629b86
diff --git a/crates/collab/src/db/queries/buffers.rs b/crates/collab/src/db/queries/buffers.rs
index 8236eb9c3b0..00de2014032 100644
--- a/crates/collab/src/db/queries/buffers.rs
+++ b/crates/collab/src/db/queries/buffers.rs
@@ -380,6 +380,16 @@ impl Database {
.collect::<Vec<_>>();
if !operations.is_empty() {
buffer_operation::Entity::insert_many(operations)
+ .on_conflict(
+ OnConflict::columns([
+ buffer_operation::Column::BufferId,
+ buffer_operation::Column::Epoch,
+ buffer_operation::Column::LamportTimestamp,
+ buffer_operation::Column::ReplicaId,
+ ])
+ .do_nothing()
+ .to_owned(),
+ )
.exec(&*tx)
.await?;
}