Skip to main content
The First Step
November 26, 2020
Question

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?

    3 replies

    PhongVu
    Community Manager
    Community Manager
    November 26, 2020

    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.

    The First Step
    November 27, 2020

    @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.

    PhongVu
    Community Manager
    Community Manager
    November 27, 2020

    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.