parent
e3b593efbd
commit
c4083b9b63
28 changed files with 103 additions and 104 deletions
|
@ -2073,8 +2073,8 @@ mod tests {
|
|||
let (done_tx1, done_rx1) = smol::channel::unbounded();
|
||||
let (done_tx2, done_rx2) = smol::channel::unbounded();
|
||||
AnyProtoClient::from(client.clone()).add_entity_message_handler(
|
||||
move |entity: Entity<TestEntity>, _: TypedEnvelope<proto::JoinProject>, mut cx| {
|
||||
match entity.read_with(&mut cx, |entity, _| entity.id).unwrap() {
|
||||
move |entity: Entity<TestEntity>, _: TypedEnvelope<proto::JoinProject>, cx| {
|
||||
match entity.read_with(&cx, |entity, _| entity.id).unwrap() {
|
||||
1 => done_tx1.try_send(()).unwrap(),
|
||||
2 => done_tx2.try_send(()).unwrap(),
|
||||
_ => unreachable!(),
|
||||
|
@ -2098,17 +2098,17 @@ mod tests {
|
|||
let _subscription1 = client
|
||||
.subscribe_to_entity(1)
|
||||
.unwrap()
|
||||
.set_entity(&entity1, &mut cx.to_async());
|
||||
.set_entity(&entity1, &cx.to_async());
|
||||
let _subscription2 = client
|
||||
.subscribe_to_entity(2)
|
||||
.unwrap()
|
||||
.set_entity(&entity2, &mut cx.to_async());
|
||||
.set_entity(&entity2, &cx.to_async());
|
||||
// Ensure dropping a subscription for the same entity type still allows receiving of
|
||||
// messages for other entity IDs of the same type.
|
||||
let subscription3 = client
|
||||
.subscribe_to_entity(3)
|
||||
.unwrap()
|
||||
.set_entity(&entity3, &mut cx.to_async());
|
||||
.set_entity(&entity3, &cx.to_async());
|
||||
drop(subscription3);
|
||||
|
||||
server.send(proto::JoinProject {
|
||||
|
|
|
@ -332,9 +332,9 @@ impl UserStore {
|
|||
async fn handle_update_contacts(
|
||||
this: Entity<Self>,
|
||||
message: TypedEnvelope<proto::UpdateContacts>,
|
||||
mut cx: AsyncApp,
|
||||
cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
this.read_with(&mut cx, |this, _| {
|
||||
this.read_with(&cx, |this, _| {
|
||||
this.update_contacts_tx
|
||||
.unbounded_send(UpdateContacts::Update(message.payload))
|
||||
.unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue