Receiving already read email as 'deleted' via delta query, and can't read initial mailbox content

Marco Solinas 1 Reputation point
2021-10-15T08:39:26.41+00:00

Hello all,
I am writing a Java application that is able to (correctly) authenticate via Client Credential Flow. This application accesses a specific, configured mailbox in our organization, to read Mail messages. This operation is done periodically from within a scheduled TimerTask. I am reading the email using delta query, and then navigating through pages in this way:
140824-2021-10-15-10-34-44-start.png

Expected behavior:

  1. The application at startup (very first access to the mailbox) can read all emails in the Inbox folder, and a first deltaLink is received with the last page
  2. Any new email in the mailbox arrived after the first access is also received by the application in the next polling period, and a new deltaLink is also received with the last page
  3. An email already received is not received again, because we use a different deltaLink to query the API in the next polling period

Actual behavior:

  1. The application is not able to read the initial snapshot of the Inbox at startup. It does receive a valid deltaLink with the last page (nextPage == null)
  2. As expected
  3. An email already received, is received again by the application in the next polling period, even if the deltaLink used to query the API is the updated one. Moreover, the Message object received has all fields set as null, except for the id (which is exactly the same String received in the previous polling period) and the additionalDataManager which is populated like: @removed -> {JsonObject@8470} "{"reason":"deleted"}"

Is the above expected?
Thank you in advance
Marco

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,591 questions
0 comments No comments
{count} votes