Open bilogic opened 2 years ago
The problem is: when you move email - first item from collection removed too. Its like iterate array and remove elements.
Workaround for me - iterate 1 by 1, and request every time first element
/** @var WhereQuery $query */
$totalMessages = $this->inboxFolder->messages()->all()->count();
for ($i = 1; $i <= $totalMessages; $i++) {
/** @var MessageCollection $messages */
$messages = $this->inboxFolder->messages()->all()->limit(1, 1)->get();
foreach ($messages as $message) {
$message->move('...'); // and so on
}
}
Describe the bug Chunk returns with 0 messages when there are still >1000 messages on server
To Reproduce Steps to reproduce the behavior: Connecting to gmail,
$chunk_size
and$start_chunk
set to 1 The issue remains even if$chunk_size
is set to 10Expected behavior There should always be >0 messages in each chunk, never 0 messages.
Screenshots
Desktop / Server (please complete the following information):
Additional context