fix: add offset and count pagination params support for chat.getMessageReadReceipts

TE
2mo ago
+61-7

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Proposed changes (including videos or screenshots)

  • Added optional offset and count pagination query parameters to ChatGetMessageReadReceiptsSchema and updated ChatGetMessageReadReceipts to extend PaginatedRequest in @rocket.chat/rest-typings.
  • Switched schema compiler for isChatGetMessageReadReceiptsProps from ajv.compile to ajvQuery.compile to properly coerce query string parameters (e.g. "0" and "10") to numbers.
  • Updated GetMessageReadReceiptsProps in apps/meteor/ee/server/api/chat.ts to extend PaginatedRequest.
  • Added an end-to-end test in apps/meteor/tests/end-to-end/api/chat.ts ensuring requests with offset and count query parameters return 200 OK.
  • Added changeset file .changeset/chat-getmessagereadreceipts-pagination-params.md.

Issue(s)

Closes #41719

Steps to test or reproduce

  1. Make an authenticated GET request to /api/v1/chat.getMessageReadReceipts passing messageId, offset, and count query parameters:
    GET /api/v1/chat.getMessageReadReceipts?messageId=<message_id>&offset=0&count=10
    
    

Summary by CodeRabbit

  • Bug Fixes

    • Fixed validation for chat.getMessageReadReceipts requests using pagination parameters.
    • The endpoint now accepts optional count and offset values while continuing to require a message ID.
    • Read receipts can now be retrieved using pagination.
  • Tests

    • Added coverage confirming paginated receipt requests return successfully with a receipts array.