RocketChat / RocketChat/Rocket.Chat.ReactNative

Request to `/api/v1/chat.syncMessages` fails with `The \"lastUpdate\" query parameter must be a valid date.`

Open
#6,057 32 comments 0 reactions 1 assignee View on GitHub

@diegolmello is already working on this.

Since Mar 18, 2025.

Dominant language
TypeScript
Stars
2.4k
Forks
1.5k
Avg merge
1d 18h
Merged PRs (30d)
90

Description

Description:

The app sends requests to /api/v1/chat.syncMessages?roomId=ROOMID&lastUpdate=undefined. The back end returns an error:

"level":35,"time":"2024-12-13T19:57:58.602Z","pid":1040862,"hostname":"rocketchat","name":"API","method":"GET","url":"/api/v1/chat.syncMessages?roomId=ROOMID&lastUpdate=undefined","userId":"USERID","userAgent":"RC Mobile; android 9; v4.55.0 (70132)","host":"rc.example.com","remoteIP":"USERIP","err":{"type":"errorClass","message":"The \"lastUpdate\" query parameter must be a valid date. [error-roomId-param-invalid]","stack":"Error: The \"lastUpdate\" query parameter must be a valid date. [error-roomId-param-invalid]\n    at app/api/server/v1/chat.ts:91:11\n    at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40\n => awaited here:\n    at Function.Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)\n    at packages/meteor.js:367:22\n    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)\n    at app/api/server/api.ts:649:39\n    at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40","isClientSafe":true,"error":"error-roomId-param-invalid","reason":"The \"lastUpdate\" query parameter must be a valid date.","errorType":"Meteor.Error"},"status":400,"responseTime":2,"msg":"The \"lastUpdate\" query parameter must be a valid date. [error-roomId-param-invalid]"}
Environment Information:
  • Rocket.Chat Server Version: 6.13.1
  • Rocket.Chat App Version: v4.55.0 and others
  • Device Name:
  • OS Version: Android/iOS all versions
Steps to reproduce:

I cannot provide exact steps to reproduce.

Expected behavior:

The app should always send a date in lastUpdate. Alternatively, the server should accept undefined lastUpdate.

Actual behavior:

N/A

Additional context:

We have some reports by users that they click on push notifications but the message does not load in channels. We suspect that this could be related.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.