I am looking for some assistance as I did a bunch of searching and saw others with similiar problems but no solution. Simply put the google apps script class/method GmailApp.search is not returning a full set of results, and it is clearly not due to a limit or anything I can see obviously like that.
Very basic usage... I have a Gmail label, lets call it "labelname" with 118 messages in it. When I search on www.gmail.com and enter "label:labelname" in the search box I get back 118 results as expected, but when I run: GmailApp.search('label:labelname'); from my script it returns only 116.
Script search syntax: threads = GmailApp.search('label:labelname');
After finding I am missing results I also added the count method to verify: Logger.log(threads.length)
Which also returns 116.
I removed my label and re-added it to all 118 and GmailApp.search still only found 116. I added my label to an additional message and tested again, now 119 on gmail.com and it went up to 117 in script result. Still missing same 2 messages.
What could it be? Their is nothing noticeable different about the 2 messages missing. Same folder, same label, same exact style message send on the same date as others.
What could cause this?
Thanks so much in advance for any suggestions!
GmailAppwill only look for threads and never messages. - Vytautas