5658726ea546fd06b8234c64c230141932a709c1
Two independent WS handlers (useMessagesWsSync for message_created/ updated/analyzed, and useMessagesStream for message_snapshot) both prepend live messages to the SWR list without enforcing order. When frames arrive out-of-order (common with batched WS delivery), the message feed gets scrambled. Fix: add sortMessages() helper that sorts newest-first by created_at (the list's stored order before .reverse() for display) and apply it in every patchLists/mutate updater: message_created, message_updated, message_analyzed, message_snapshot, and useLoadMore page appends. Function declaration is hoisted so useLoadMore (defined above the helper) can use it.
Description
Bete Discord moderation watcher
26 MiB
Languages
TypeScript
96.9%
Nix
0.9%
Shell
0.8%
CSS
0.6%
PLpgSQL
0.5%
Other
0.3%