generally in graph we can obtain the high level details of a folder using folder query and next level details such as the data of emails were obtained using message query usually the high level data such as child folder, total email count and other details we be same as of the actual items present in that folder & the no of messages returned in response with the message query.
but, in come cases the Total message count of a folder obtained with the folder query doesn’t match the actual number of messages obtained in the message query within a folder.
I really didn’t guess the reason behind this, is there any possible hidden items or any other thing that isolates set of emails which is not included in any of the responses & not viable in outlook.
I’d like to share the response of one of my folder that falls within the above case I mentioned. the reference folder attached is discoveryholds under recoverable items which is not actually seen by users in outlook. but, I also see this same issue in deleted items of many of my mailboxes within my tenant.
below is the response obtained for the
request on folder details with folder query
request on details of messages with in the folder with count based on
the above response is obtained from which seems to be correct while I manually counted it.
https://graph.microsoft.com/beta/me/mailFolders/recoverableitemsdiscoveryholds/messages?$count=true
It would be helpful if I know the reason behind this. Thanks in advance.