RocketChat / RocketChat/Rocket.Chat

Cannot filter livechat history messages with "ts" queryparameter

Open
#20,854 1 comment 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:

Not possible to use "ts" query parameter to filter livechat history messages. Parameter is ignored.

Steps to reproduce:
  1. As a guest, open a new live chat.
  2. Send a couple of messages
  3. Using the REST API to load the Livechat history and specify the "ts"parameter to only retrieve the latest message

Example:
https://myserver.rocket.chat/api/v1/livechat/messages.history/myroomid?token=guestToken&ls=2021-02-19T12:39:53.746Z

Expected behavior:

The history should only return messages AFTER the given timestamp.

Actual behavior:

All messages are returned.

Server Setup Information:
  • Version of Rocket.Chat Server: 3.10.5
  • Commit: 1e36f4183852248cece3b1ad092bc566a8cfbd52
  • Operating System: Linux
  • Deployment Method: Cloud
  • Number of Running Instances: 1
  • DB Replicaset Oplog: wiredTiger
  • NodeJS Version: v12.18.4
  • MongoDB Version: 4.2.8
  • Deployment ID: uMe4Y5PA8XksWcbRr
Client Setup Information
  • Desktop App or Browser Version: Chrome
  • Operating System: Windows 10 1803
Additional context

If there is no magic that I don't see the parameter is actually called ls (found here but called ts in the documentation.

Either way, neither of the parameters does anything.

Not sure if the documentation is missing something or if I'm doing something wroing.

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 with app/livechat/server/api/v1/message.js at the referenced history endpoint, then compare its query parameter name and behavior with the linked REST API documentation. Reproduce the request using the provided guest-chat steps and timestamp. Done means the documented parameter and endpoint behavior agree and history results are filtered after the supplied timestamp.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
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.