RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.78k stars 10.71k forks source link

IM/DM messages sorting relies only on ts, unlike group messages #34008

Open MahmoudMowiena opened 6 days ago

MahmoudMowiena commented 6 days ago

Description:

Sorting for IM/DM messages currently uses only the ts (timestamp) field, whereas group messages support sorting by multiple parameters. This inconsistency limits flexibility and prevents custom sorting options for direct and instant messages.

Steps to reproduce:

  1. Query for IM/DM messages using the Rocket.Chat API or interface.
  2. Attempt to use sorting parameters (e.g., by sender or custom fields).
  3. Observe that the sorting relies solely on the ts timestamp.

Expected behavior:

IM/DM messages should support sorting by multiple parameters, similar to group messages, to allow consistent and customizable sorting behavior.

Actual behavior:

IM/DM messages are sorted only by the ts timestamp, regardless of the specified parameters.

Additional context

This issue creates inconsistency between group and IM/DM sorting functionality. Fixing this will align the behavior across all message types.

reetp commented 6 days ago

This is really a feature request - the system isn't broken but just doesn't work the way you want it to.

I'll refer it to the team but have no idea if this is something they want to fix or have another solution. I know there are various things happening regarding upgrading the interface so they may already have something in hand - and why you should always ask in the forums or on open before wasting time trying to fix things.

Note that PRs can take a LONG time to get reviewed so don't expect anything back in a hurry.

Thanks.

MahmoudMowiena commented 6 days ago

@reetp Thank you for your reply! I would like to highlight that, according to the documentation, the sorting parameter is supposed to work with any property, not just the ts timestamp. That’s why I initially reported it as a bug. I would appreciate any clarification on this.

reetp commented 6 days ago

You don't need to @ people thanks - it just gets annoying.

Where does it say it in the docs? It may be that the docs need fixing.

MahmoudMowiena commented 6 days ago

Regarding the IM messages retrieval: https://developer.rocket.chat/apidocs/list-dm-messages and regarding the Groups messages retrieval: https://developer.rocket.chat/apidocs/get-group-messages You would clearly see that the sorting param, as per the documentation, should work with any property, however that's not the case.

reetp commented 6 days ago

Thanks.

I'll ask the team to review it.

As per my previous, don't expect any response in a hurry!

MahmoudMowiena commented 6 days ago

Thanks for your time.

casalsgh commented 5 days ago

Thanks for reporting and the contribution; will ask folks to review