You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm always frustrated when the order of users in the users array is inconsistent in the roomData object. Currently, the order is only reassigned when sender is greater than to, which can lead to unpredictability and potential issues when comparing or processing room data.
Describe the solution you'd like
I would like to improve the initialization of the roomData object to ensure a consistent and predictable order of user IDs. This can be achieved by sorting the users array numerically and then converting the user IDs back to strings. This approach guarantees that the user IDs are always stored in a consistent order.
Describe alternatives you've considered
An alternative solution could be to conditionally assign the roomData object only when sender is greater than to, as currently implemented. However, this approach does not ensure a consistent order of user IDs in all cases, which can lead to potential issues.
Additional context
Here is the improved version of the code to ensure consistent user order:
Is your feature request related to a problem? Please describe.
I'm always frustrated when the order of users in the
users
array is inconsistent in theroomData
object. Currently, the order is only reassigned whensender
is greater thanto
, which can lead to unpredictability and potential issues when comparing or processing room data.Describe the solution you'd like
I would like to improve the initialization of the
roomData
object to ensure a consistent and predictable order of user IDs. This can be achieved by sorting theusers
array numerically and then converting the user IDs back to strings. This approach guarantees that the user IDs are always stored in a consistent order.Describe alternatives you've considered
An alternative solution could be to conditionally assign the
roomData
object only whensender
is greater thanto
, as currently implemented. However, this approach does not ensure a consistent order of user IDs in all cases, which can lead to potential issues.Additional context
Here is the improved version of the code to ensure consistent user order:
Contributor: @gab within the app
This version sorts the user IDs as strings, ensuring a consistent and predictable order in the
users
array.If you want to speed up the process of this issue, please send 🚀 as a reaction.
The text was updated successfully, but these errors were encountered: