Skip to content

fix(realtime): prevent races during paged message loads - #1547

Merged
realcodesiman merged 3 commits into
mainfrom
realcodesiman/debug-realtime-message
Oct 24, 2026
Merged

realcodesiman merged 3 commits into
mainfrom
realcodesiman/debug-realtime-message

Conversation

@realcodesiman

@realcodesiman realcodesiman commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Prevent stale paginated message responses from overwriting the active conversation.
  • Preserve realtime messages and the scroll anchor while older history loads.

Changes

  • Make chat-store merge, deduplicate, and sequence older message pages.
  • Make MessageList offset virtualized rows by the accepted prepend count.
  • Cover realtime pagination races in chat-store and message-list tests.

Test plan

  • Lefthook pre-commit: pnpm ultracite fix
  • Lefthook pre-commit: repository check-types
  • pnpm --filter builder test -- __tests__/chat-store.test.ts __tests__/message-list.test.tsx
  • Manually verify realtime messages arriving during history pagination

@github-actions github-actions Bot added the bug Something isn't working as expected label Oct 23, 2026
@realcodesiman
realcodesiman merged commit 92b70e2 into main Oct 24, 2026
4 checks passed
@realcodesiman
realcodesiman deleted the realcodesiman/debug-realtime-message branch October 24, 2026 03:23
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
* fix(realtime): prevent races during paged message loads

* fix(realtime): preserve rapid message sends

* fix(realtime): surface failed message sends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant