google-api-nodejs-client
google-api-nodejs-client copied to clipboard
Query mails after date returns results that before this date
Environment details
- OS: Ubuntu 22.04.2 LTS / Google Cloud Run / Cloud Run Jobs
- Node.js version: 18.16.1
- npm version: 9.5.1
-
googleapis
version: "@googleapis/gmail": "^3.0.0"
Steps to reproduce
- Create a gmail client for some email in your company with domain wide delegation.
- List messages with query like
{in:inbox in:outbox} after:1689576392 before:1689605192
(after - some stored datetime, before - calculated range in 8 hours) - Returned list contains messages, that have date BEFORE 1689576392.
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.
I set time in after
stored from last processed message that gmail returns.