Snapshot channel notes buffers when everyone leaves

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Max Brunsfeld
2023-08-23 18:37:01 -07:00
committed by Mikayla
co-authored by Mikayla
parent 4eff8ad186
commit 1d08f44e70
9 changed files with 273 additions and 97 deletions
+8 -2
View File
@@ -10,7 +10,6 @@ test_both_dbs!(
);
async fn test_channel_buffers(db: &Arc<Database>) {
// Prep database test info
let a_id = db
.create_user(
"user_a@example.com",
@@ -155,5 +154,12 @@ async fn test_channel_buffers(db: &Arc<Database>) {
assert_eq!(zed_collaborators, &[]);
assert_eq!(cargo_collaborators, &[]);
// TODO: test buffer epoch incrementing
// When everyone has left the channel, the operations are collapsed into
// a new base text.
let buffer_response_b = db
.join_channel_buffer(zed_id, b_id, connection_id_b)
.await
.unwrap();
assert_eq!(buffer_response_b.base_text, "hello, cruel world");
assert_eq!(buffer_response_b.operations, &[]);
}