Describe the bug
In the Messages tab, when a message is sent the received messages shown above don't display properly, and appear as sent messages with content mixed with sent messages. Messages all appear as expected after refreshing the page.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Appearance of sent and received messages should not change when a new message is sent.
Screenshots
Progression from left to right, prior to sending, immediately after, and then after refreshing:

Environment
ciha-rapidpro-support, which is branched off of 3.8 but no known changes to the Messages tab.Additional context
Refreshing resets the messages to their expected location and color.
Thanks for flagging this @abbyad cc @michaelkohn
Ready for AT on 6335-correct-message-labels.
A bunch of message actions have been refactored, so please make sure that loading long treads works correctly, also updates to loaded threads.
(do remember that admins don't watch the changes feed with include_docs, so to view new received messages that are not authored by themselves, they need to refresh the page).
A bunch of message actions have been refactored, so please make sure that loading long treads works correctly, also updates to loaded threads.
I had noticed just recently that clicking between message conversations before the previous one is fully loaded can end up merging both conversation threads. Keep that in mind with testing this issue, and report if it is happening.
@abbyad if this happened before, I don't think anything I've changed in my PR would have fixed it, unfortunately.
I am AT this ticket.
This looks good to me. Tested larger convos, convos back n forth offline and letting it sync on the timer and seeing the message order correct. @dianabarsan feel free to merge and close.
Merged.