Merge branch 'main' into namespace-actions

This commit is contained in:
Max Brunsfeld 2022-04-08 11:48:43 -07:00
commit ed2b690b9e
10 changed files with 523 additions and 405 deletions

View file

@ -6,7 +6,6 @@ use anyhow::{anyhow, Result};
use futures::{future::BoxFuture, stream::BoxStream, Future, StreamExt};
use gpui::{executor, ModelHandle, TestAppContext};
use parking_lot::Mutex;
use postage::barrier;
use rpc::{proto, ConnectionId, Peer, Receipt, TypedEnvelope};
use std::{fmt, rc::Rc, sync::Arc};
@ -23,7 +22,6 @@ struct FakeServerState {
connection_id: Option<ConnectionId>,
forbid_connections: bool,
auth_count: usize,
connection_killer: Option<barrier::Sender>,
access_token: usize,
}
@ -76,15 +74,13 @@ impl FakeServer {
Err(EstablishConnectionError::Unauthorized)?
}
let (client_conn, server_conn, kill) =
Connection::in_memory(cx.background());
let (client_conn, server_conn, _) = Connection::in_memory(cx.background());
let (connection_id, io, incoming) =
peer.add_test_connection(server_conn, cx.background()).await;
cx.background().spawn(io).detach();
let mut state = state.lock();
state.connection_id = Some(connection_id);
state.incoming = Some(incoming);
state.connection_killer = Some(kill);
Ok(client_conn)
})
}