This commit is contained in:
2026-09-01 09:14:33 +07:00
parent 8f272f1fe8
commit a6e50cf3aa
16 changed files with 116 additions and 78 deletions
+6 -2
View File
@@ -80,7 +80,11 @@ impl PersonRegistry {
tasks.push(cx.spawn(async move |this, cx| {
while let Ok(event) = rx.recv_async().await {
this.update(cx, |this, cx| {
// `update_in` (rather than `update`) routes through a
// try-borrow: on wasm a task poll that lands while the app
// context is borrowed can't panic and kill this consumer
// (which would stall the whole metadata pipeline).
this.update_in(cx, |this, _window, cx| {
// Drain the whole queue in a single update so a burst of
// events collapses into one repaint instead of one per
// event (important on wasm, where everything runs on the
@@ -231,7 +235,7 @@ impl PersonRegistry {
self.tasks.push(cx.spawn(async move |this, cx| {
if let Ok(persons) = task.await {
this.update(cx, |this, cx| {
this.update_in(cx, |this, _window, cx| {
this.bulk_insert(persons, cx);
})
.ok();