NewChat '+' doesn't add participants #46

Closed
opened 2026-04-19 08:25:33 +00:00 by zaelgohary · 1 comment
Member

Two related bugs in islands/chat_form.rs:

  1. The component mirrored props.contacts into a signal at mount but never updated it afterwards — Dioxus' use_signal init closure only runs once. When the parent loaded contacts asynchronously, the form's internal copy stayed empty and the '+' onclick handler couldn't find the target contact.
  2. The initial fix used all_contacts.read() to compare against props.contacts, which establishes a reactive subscription and defeats the guard (every signal tick re-triggers the conditional).

Fix: sync on every render using .peek() so the guard is non-subscribing.

Two related bugs in `islands/chat_form.rs`: 1. The component mirrored `props.contacts` into a signal at mount but never updated it afterwards — Dioxus' `use_signal` init closure only runs once. When the parent loaded contacts asynchronously, the form's internal copy stayed empty and the '+' onclick handler couldn't find the target contact. 2. The initial fix used `all_contacts.read()` to compare against `props.contacts`, which establishes a reactive subscription and defeats the guard (every signal tick re-triggers the conditional). **Fix**: sync on every render using `.peek()` so the guard is non-subscribing.
zaelgohary changed title from bug: NewChat '+' doesn't add participants; prop sync subscribes unnecessarily to NewChat '+' doesn't add participants 2026-04-19 08:32:19 +00:00
Author
Member

Fixed by #56.

Fixed by https://forge.ourworld.tf/lhumina_code/hero_archipelagos/pulls/56.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos#46
No description provided.