googleapis / google-api-nodejs-client

Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.
https://googleapis.dev/nodejs/googleapis/latest/
Apache License 2.0
11.41k stars 1.92k forks source link

Query mails after date returns results that before this date #3290

Open Aliaksandr-Kasko-JazzTeam opened 1 year ago

Aliaksandr-Kasko-JazzTeam commented 1 year ago

Environment details

Steps to reproduce

  1. Create a gmail client for some email in your company with domain wide delegation.
  2. List messages with query like {in:inbox in:outbox} after:1689576392 before:1689605192 (after - some stored datetime, before - calculated range in 8 hours)
  3. Returned list contains messages, that have date BEFORE 1689576392.
03hgryan commented 7 months ago

I believe that this is an issue with time zone. Not sure which time zone this server is, but I think you can handle this issue with adding specific time in the after: query for your time client's zone.

Aliaksandr-Kasko-JazzTeam commented 7 months ago

I set time in after stored from last processed message that gmail returns.