messaging: after page reload, all bubbles render as bubble-other (post-reload regression of #62) #192

Open
opened 2026-04-29 13:30:17 +00:00 by rawdaGastan · 0 comments
Member

Summary

Post-reload regression of #62 (closed). The optimistic-send patch added in archipelago.rs:293-296 only forces is_own = true on the just-sent message; after F5 every message in the thread (including ones the user just sent) renders left-aligned as bubble-other — there is no visual signal of which side of the conversation you are on.

This was acknowledged as a known limitation in the original #62 body ("subsequent full refetches will still show the server-stamped sender") but was closed without follow-up. Filing this as a separate ticket so it stays on the radar.

Repro

  1. /space/default/messaging, create DM with QA Tester.
  2. Send a message → bubble-own ✓ (correct, optimistic patch fires).
  3. F5.
  4. Re-open the same chat — own message now bubble-other (left-aligned, no ✓).

DevTools confirms:

Array.from(document.querySelectorAll('[class*="message-bubble"]'))
     .map(b => b.className);
// → all bubbles have "bubble-other" after reload

Root cause (per the code itself)

// archipelagos/messaging/src/archipelago.rs:293-296
// Server hardcodes sender_public_key = "system" until auth lands, so the
// is_own check can't match. We know we just sent this — render as own.
msg_data.is_own = true;
msg_data.sender_name = "Me".to_string();

The patch only runs in handle_send. Reloading drops active_messages and refetches from the server — every historical message comes back with sender_public_key = "system" and the patch is gone.

Suggested fix (any one)

  • Persist own_user_key per context (so refetch can match), OR
  • Until auth lands, treat sender_public_key == SYSTEM_KEY as is_own = true whenever own_user_key is empty/system, OR
  • Have the server stamp sender_public_key with the X-Hero-Context value (depends on the cross-context fix — see hero_osis #40).
  • #62 (closed) — original optimistic-send fix.
  • #51 (closed) — sibling: empty user_key rendered all messages as 'Me'. The current fix flipped it the other way.
  • hero_osis #40 — server-side context isolation, related root cause.

Found via QA session 2026-04-29 (qa/messaging_2026-04-29/FINDINGS.md).

## Summary Post-reload regression of [#62 (closed)](https://forge.ourworld.tf/lhumina_code/hero_archipelagos/issues/62). The optimistic-send patch added in `archipelago.rs:293-296` only forces `is_own = true` on the *just-sent* message; after F5 every message in the thread (including ones the user just sent) renders left-aligned as `bubble-other` — there is no visual signal of which side of the conversation you are on. This was acknowledged as a known limitation in the original #62 body ("subsequent full refetches will still show the server-stamped sender") but was closed without follow-up. Filing this as a separate ticket so it stays on the radar. ## Repro 1. `/space/default/messaging`, create DM with QA Tester. 2. Send a message → bubble-own ✓ (correct, optimistic patch fires). 3. F5. 4. Re-open the same chat — own message now bubble-other (left-aligned, no ✓). DevTools confirms: ```js Array.from(document.querySelectorAll('[class*="message-bubble"]')) .map(b => b.className); // → all bubbles have "bubble-other" after reload ``` ## Root cause (per the code itself) ```rust // archipelagos/messaging/src/archipelago.rs:293-296 // Server hardcodes sender_public_key = "system" until auth lands, so the // is_own check can't match. We know we just sent this — render as own. msg_data.is_own = true; msg_data.sender_name = "Me".to_string(); ``` The patch only runs in `handle_send`. Reloading drops `active_messages` and refetches from the server — every historical message comes back with `sender_public_key = "system"` and the patch is gone. ## Suggested fix (any one) - Persist `own_user_key` per context (so refetch can match), OR - Until auth lands, treat `sender_public_key == SYSTEM_KEY` as `is_own = true` whenever own_user_key is empty/`system`, OR - Have the server stamp `sender_public_key` with the `X-Hero-Context` value (depends on the cross-context fix — see hero_osis #40). ## Related - [#62 (closed)](https://forge.ourworld.tf/lhumina_code/hero_archipelagos/issues/62) — original optimistic-send fix. - [#51 (closed)](https://forge.ourworld.tf/lhumina_code/hero_archipelagos/issues/51) — sibling: empty user_key rendered all messages as 'Me'. The current fix flipped it the other way. - [hero_osis #40](https://forge.ourworld.tf/lhumina_code/hero_osis/issues/40) — server-side context isolation, related root cause. Found via QA session 2026-04-29 (`qa/messaging_2026-04-29/FINDINGS.md`).
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#192
No description provided.