I am currently troubleshooting a script we use to collect audit logs from O365. For some time now, I was writing debug statements to the console to keep track of various information. While debugging I noticed that after collecting 20000 records in a session, the ResultCount (i.e total count of records to be collected) was updating to a new value.
I can't find any mention in documentation or otherwise. Also, it should be noted that once the ResultCount updates, the ResultIndex updates to 0 as well. Currently I loop as normal, but it seems to never finish as the Count and Index keep resetting. Finally, I compared the record in index 1 of both sets and they were completely different.
How should I handle this case? Thanks in advance.