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
The official documentation for the GET /api/v1/chat.getPinnedMessages endpoint states that a sort parameter can be passed to sort pinned messages. However, after reviewing the actual source code of the endpoint, it appears that the sort parameter is neither parsed nor passed into the internal message query function, rendering it ineffective.
Steps to Reproduce
Call the chat.getPinnedMessages endpoint with a sort query parameter, e.g.:
GET /api/v1/chat.getPinnedMessages?roomId=GENERAL&sort={"ts":-1}
(Properly URL-encoded: sort=%7B%22ts%22%3A-1%7D)
The response always returns messages in the default order (likely unsorted or backend-determined), and the sort order has no effect.
Source Code Analysis
The current implementation of chat.getPinnedMessages does not parse or forward the sort parameter:
The API should properly accept and parse the sort parameter (e.g., {"ts": -1}) from the query string and pass it to Messages.findPaginatedPinnedByRoom().
The text was updated successfully, but these errors were encountered:
Description
The official documentation for the
GET /api/v1/chat.getPinnedMessages
endpoint states that asort
parameter can be passed to sort pinned messages. However, after reviewing the actual source code of the endpoint, it appears that thesort
parameter is neither parsed nor passed into the internal message query function, rendering it ineffective.Steps to Reproduce
chat.getPinnedMessages
endpoint with asort
query parameter, e.g.:GET /api/v1/chat.getPinnedMessages?roomId=GENERAL&sort={"ts":-1}
(Properly URL-encoded:
sort=%7B%22ts%22%3A-1%7D
)Source Code Analysis
The current implementation of
chat.getPinnedMessages
does not parse or forward thesort
parameter:Even though the internal Messages.findPaginatedPinnedByRoom method does accept a FindOptions object that includes a sort field:
Expected Behavior
The API should properly accept and parse the
sort
parameter (e.g.,{"ts": -1}
) from the query string and pass it toMessages.findPaginatedPinnedByRoom()
.The text was updated successfully, but these errors were encountered: