[Omnichannel] How to mark a livechat room as read by visitor? (delivery receipt)


I’ve created a custom frontend for rocketchat livechat using javascript SDK. I’ve seen SDK does not have protocol for marking a rid as read.

Lurking around codebase I saw this method: readMessages and an API subscriptions.read but as I understand, they don’t work for livechat rooms. Both methods give me user not authenticated errors.

I tried disabling these checks and server crashes with error bellow. I’ve tried calling these methods from visitor side (with token), tried calling it from server side using bot user (without token json) but the same error happened

Is there any way to mark rooms as read from visitor side?

Server Setup Information

  • Version of Rocket.Chat Server: 3.8.1 (also tested on 3.3.3)
  • Operating System: Linux
  • Deployment Method: docker-compose
  • Number of Running Instances: 2
  • NodeJS Version: 12 lts
  • MongoDB Version: 3 replica set members all v4.2
  • Proxy: haproxy
  • Firewalls involved: AWS rules

Any additional Information

I20201125-11:35:50.053(2)? Meteor ➔ method getReadReceipts -> userId: bz8KYwvuHp9qmou4j, arguments: [{"messageId":"SHwpo7oH8LtPaTbKA"}]
I20201125-11:35:50.054(2)? Meteor ➔ method canAccessRoom -> userId: bz8KYwvuHp9qmou4j, arguments: ["df6ebf06-d311-4f9a-ad5b-6d743fe6f90c","bz8KYwvuHp9qmou4j"]
I20201125-11:35:53.824(2)? Meteor ➔ method readMessages -> userId: kEE8KbCyo4eY28gHa, arguments: ["df6ebf06-d311-4f9a-ad5b-6d743fe6f90c",{"token":"cd7442ed-828a-47d1-b894-6252edcf7c8c"}]
W20201125-11:35:53.835(2)? (STDERR) === UnHandledPromiseRejection ===
W20201125-11:35:53.835(2)? (STDERR) Error: error-invalid-subscription
W20201125-11:35:53.835(2)? (STDERR)     at server/lib/markRoomAsRead.ts:10:9
W20201125-11:35:53.835(2)? (STDERR)     at /Users/eugen/.meteor/packages/promise/.
W20201125-11:35:53.836(2)? (STDERR) ---------------------------------
W20201125-11:35:53.836(2)? (STDERR) Errors like this can cause oplog processing errors.
W20201125-11:35:53.836(2)? (STDERR) Setting EXIT_UNHANDLEDPROMISEREJECTION will cause the process to exit allowing your service to automatically restart the process
W20201125-11:35:53.836(2)? (STDERR) Future node.js versions will automatically exit the process
W20201125-11:35:53.836(2)? (STDERR) =================================
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.