I'm trying to page through getListItemChangesSinceToken
to get an entire list and then any changes to it but I'm getting very inconsistent results.
This is what I do to get the initial list of changes:
- Call
getListItemChangesSinceToken
(using the PNP JS library) with a rowlimit and noChangeToken
orPaging ListItemCollectionPositionNext
. - Get some results, the next
ChangeToken
andListItemCollectionPositionNext
- repeat from 1 with the received
Paging ListItemCollectionPositionNext
until there's noListItemCollectionPositionNext
in the results - Store the
ChangeToken
from the very first results for calling next time.
Doing it this way on a test collection with 42 folders and 10 files gives me 14 folders+0 files when I use row limit 3 but 17 folders when I use row limit 8, and 16 folders with low limit 5. The paging goes through several iterations but skips a whole bunch of data it seems.
Furthermore, the paged results have their timestamps changed from UTC ISO format to local time space-separated format.
Here are two examples of the same folder result (after XML to JSON conversion), from the initial result and when it's part of a paged result. Timestamps and user references seem to change.
initial:
"ows_Created": "2019-12-07T13:07:28Z",
"ows_Author": "35;#Wout Mertens,#i:0#.f|membership|[email protected],#[email protected],#[email protected],#Wout Mertens",
paged:
"ows_Created": "2019-12-07 05:07:28",
"ows_Author": "35;#Wout Mertens",
Is this API just broken? Am I using it wrongly?