Hi,
Consider the following example:
$deltaPageRequest = $graph->createCollectionRequest('GET', '/me/mailFolders/[id]/messages/delta')
->setPageSize(50)
->setReturnType(Model\Message::class);
while (!$deltaPageRequest->isEnd()) {
$items = $deltaPageRequest->getPage();
foreach ($items as $item) {
//do stuff
}
}
Here we sync the messages in a specific folder in the user's mailbox. This works fine but if there are a lot of messages in the folder some problems can occur. (I'm trying to sync 40000 messages)
If the access token expires while we are syncing this huge amount of messages we get a "InvalidAuthenticationToken" exception.
It's possible to catch this exception and set a new token for the graph object:
But you can't change the access token for the $deltaPageRequest.
So you can only create a new CollectionRequest and start again. But you also can't specify a start page for the CollectionRequest. So if we were syncing page 50 and we received the "InvalidAuthenticationToken" exception we can't recreate the $deltaPageRequest en start from page 50 and proceed. We have to start from page 1 again.
So what would be the best solution for this problem ? Change the GraphRequest class and make it possible to change the access token or change the GraphCollectionRequest class to specify the page for the first request ? Or is there a better solution ?
AB#7576
Hi,
Consider the following example:
Here we sync the messages in a specific folder in the user's mailbox. This works fine but if there are a lot of messages in the folder some problems can occur. (I'm trying to sync 40000 messages)
If the access token expires while we are syncing this huge amount of messages we get a "InvalidAuthenticationToken" exception.
It's possible to catch this exception and set a new token for the graph object:
But you can't change the access token for the $deltaPageRequest.
So you can only create a new CollectionRequest and start again. But you also can't specify a start page for the CollectionRequest. So if we were syncing page 50 and we received the "InvalidAuthenticationToken" exception we can't recreate the $deltaPageRequest en start from page 50 and proceed. We have to start from page 1 again.
So what would be the best solution for this problem ? Change the GraphRequest class and make it possible to change the access token or change the GraphCollectionRequest class to specify the page for the first request ? Or is there a better solution ?
AB#7576