chat switch: stale flash + rapid-switch race #48

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

Two related issues in archipelago.rs:

  1. handle_chat_click only updated route; the previous chat's active_chat / active_messages were visible until the new fetch completed, causing a noticeable flash of stale data.
  2. If the user switched A→B before A's fetch finished, A's late response could still land in active_messages and clobber B's.

Fix: clear active_chat / active_messages / error on click. In the chat-load effect, define a still_on_chat(&sid) check that reads route.peek() after each .await and bails out early if the user has moved on.

Two related issues in `archipelago.rs`: 1. `handle_chat_click` only updated `route`; the previous chat's `active_chat` / `active_messages` were visible until the new fetch completed, causing a noticeable flash of stale data. 2. If the user switched A→B before A's fetch finished, A's late response could still land in `active_messages` and clobber B's. **Fix**: clear `active_chat` / `active_messages` / `error` on click. In the chat-load effect, define a `still_on_chat(&sid)` check that reads `route.peek()` after each `.await` and bails out early if the user has moved on.
zaelgohary changed title from bug: switching chats flashes old data + rapid switch can clobber the view to chat switch: stale flash + rapid-switch race 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#48
No description provided.