question

Asfand Sajjad avatar image
Asfand Sajjad asked ·

Message-store get message list skipping latest message

We are querying message-store get message list using the vendor create date (returned while sending sms).
e.g.
if we have 3 messages in the message-store with vendor create dates as 2020-11-26T12:52:02.000Z, 2020-11-26T09:49:04.000Z, 2020-11-26T09:49:02.000Z
and we use the "2020-11-26T09:49:02.000Z" as dateFrom and "2020-11-26T12:52:02.000Z" as dateTo.

The message with "2020-11-26T12:52:02.000Z" gets skipped.

Is there any delta involved? Am I missing some information?

message-storeget message list
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered ·

Time zone. Times logged in the message store are UTC-00. When you specify the dateFrom and dateTo, make sure you convert the local time to UTC time accordingly.

Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Asfand Sajjad avatar image
Asfand Sajjad answered ·

@Phong Vu Thank you for reaching out.
We are already using datetime returned by sendSMS endpoint i.e. vendorCreateDate from message-store and its in UTC time zone.

To be more elaborate about the usecase,
lets take this message into account. Assume this specific message is the latest one and we use the creationTime as dateTo (its already in UTC).
1606463086624.png
now this message should be returned in the get message list response but it's not what's happening.

if I add a millisecond in this time, and then query the message-store. This message is returned in the response.

Simple putting: Get Message list isn't returning the message having creationTime exactly equal to dateTo in request.


1606463086624.png (18.7 KiB)
1 comment Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I have not tested this but if it is the case, then maybe the dateTo is not "<=". The easiest way to deal with is to convert to timestamp and add a few millisecond to the timestamp then convert back to date&time string to read. Can you do that quick test and let me know if that helps.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.