RocketChat / RocketChat/Rocket.Chat

Can't sync messages of livechat

Open
#23,864 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Using endpoint chat.syncMessages, i can't get past messages of active livechat.
I use both X-Auth-Token & X-User-Id with returned value of realtime API live chat visitor (getInitialData method).

Steps to reproduce:
  1. Call realtime api of register & getInitialData as visitor.
  2. Send live chat message until you get the roomId.
  3. Call chat.syncMessages rest api using visitor data, designated roomId & lastUpdated message.
Expected behavior:

Response should be return result of updated messages & success true.

Actual behavior:

Response return status error instead & the message is 'You must be logged in to do this'.

Server Setup Information:
  • Version of Rocket.Chat Server: 3.18 self hosted
  • Operating System: Mac 11.6
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.22.1 - x64
  • MongoDB Version: 4.0.26
Client Setup Information
  • Desktop App or Browser Version: -
  • Operating System: Mac 11.6
Additional context
Relevant logs:

{
"status": "error",
"message": "You must be logged in to do this."
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the chat.syncMessages REST endpoint and trace how visitor credentials from the realtime register and getInitialData flow into its authentication check. Reproduce the listed sequence with an active livechat and verify whether the endpoint returns updated messages with success true instead of the reported login error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.