Skip to content

fix(messages): show inbox rows before the chat history loads - #6867

Merged
rebelchris merged 3 commits into
mainfrom
fix/dm-inbox-show-rows-early
Oct 12, 2026
Merged

rebelchris merged 3 commits into
mainfrom
fix/dm-inbox-show-rows-early

Conversation

@rebelchris

@rebelchris rebelchris commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • The inbox showed skeletons until the chat socket was up and one MAM lookup per conversation (up to 50) had finished. ejabberd answers them one at a time per session: 30 empty lookups took about 78ms vs about 6ms for one. Each lookup has a 10s timeout, and Promise.allSettled waits for the slowest. Before any of that, the strophe chunk and token load only after the page mounts.
  • Adds dmConversationPeersQueryOptions (the API list only: peer and unread count, one request) and renders those rows, openable and aria-busy, while the full inbox loads. The rows switch to last-message previews when the history arrives.
  • Test: ConversationList.spec.tsx covers rows while pending and the swap to previews. All features/messages tests pass.

Known trade-offs / follow-ups:

  • Rows are in API order (by creation) until the previews arrive, then re-sort by last message.
  • The API list is requested twice (here and inside listConversations). It is cheap; folding it into one needs a transport interface change.
  • The real fix is server-side: have daily-api keep lastMessageAt + preview on DirectMessageConversation. markDirectMessageSent already receives the preview. Then the inbox needs no MAM lookups at all, and opening a thread on page load stops queueing behind them.

Events

No

Experiment

No


🤖 Investigated and drafted by Smith (AI) for @rebelchris.

Preview domain

https://fix-dm-inbox-show-rows-early.preview.app.daily.dev

The inbox stayed on skeletons until the chat socket was up and one archive lookup per conversation had finished (the chat server answers those one at a time, and a slow one can hold the list for up to 10s). The API already knows who each conversation is with and the unread count, so show those rows, openable, while the last messages load.
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-webapp Ready Ready Preview Oct 12, 2026 11:34am UTC

Request Review

@rebelchris
rebelchris merged commit a7f3bf6 into main Oct 12, 2026
2 of 5 checks passed
@rebelchris
rebelchris deleted the fix/dm-inbox-show-rows-early branch October 12, 2026 11:29

This branch was successfully deployed

1 active deployment
Preview — f9855f88 Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant