Sorting messages correctly
Description
Currently, we are using the inserted_at timestamp to sort messages in the chatroom. While this approach works well in most cases, it poses a significant problem when multiple messages are sent within the same second, leading to incorrect ordering.
Proposed Solution
To improve the sorting of messages, we propose increasing the precision of the inserted_at timestamps to include milliseconds. This change should help alleviate the issues arising from messages being sent too closely together.
Considerations
Adding milliseconds will enhance ordering accuracy, but...Can messages actually be sent within the same millisecond? It's possible, yet this solution still represents an improvement over the current system.
Implementing this change will improve the overall user experience by ensuring that messages are presented in the correct order.
Sorting messages correctly
Description
Currently, we are using the
inserted_attimestamp to sort messages in the chatroom. While this approach works well in most cases, it poses a significant problem when multiple messages are sent within the same second, leading to incorrect ordering.Proposed Solution
To improve the sorting of messages, we propose increasing the precision of the
inserted_attimestamps to include milliseconds. This change should help alleviate the issues arising from messages being sent too closely together.Considerations
Adding milliseconds will enhance ordering accuracy, but...Can messages actually be sent within the same millisecond? It's possible, yet this solution still represents an improvement over the current system.
Implementing this change will improve the overall user experience by ensuring that messages are presented in the correct order.