Skip to content

Conversation

@deepak0x
Copy link
Contributor

@deepak0x deepak0x commented Jan 29, 2026

This PR fixes incorrect message insertion behavior and removes inconsistencies in how messages are stored and rendered across the application.

Closes #1082


Solution

This PR standardizes message storage across the application by using a single, consistent order:

Ascending order (Oldest → Newest) everywhere.

Key Changes

  • Updated insertMessage
    The insertion logic now supports ascending lists by finding the correct index where the next message is newer:

    new Date(m.ts) > new Date(message.ts)
    
  • Updated messageStore
    The setMessages action now reverses the server response (which is descending by default) before storing it, ensuring all messages in the store are ascending.

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.

Bug: Broken Message Insertion Logic in messageListHelpers

1 participant