Skip to content

Commit

Permalink
fixup! feat: implement periodic full sync job to repair cache inconsi…
Browse files Browse the repository at this point in the history
…stencies
  • Loading branch information
st3iny committed Sep 10, 2024
1 parent ddf40cc commit 84d72f9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/Service/Sync/ImapToDbSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

class ImapToDbSynchronizer {
/** @var int */
public const MAX_NEW_MESSAGES = 5000;
public const MAX_NEW_MESSAGES = 5000000;

/** @var DatabaseMessageMapper */
private $dbMapper;
Expand Down Expand Up @@ -99,7 +99,6 @@ public function __construct(DatabaseMessageMapper $dbMapper,
public function syncAccount(Account $account,
LoggerInterface $logger,
bool $force = false,
bool $useClientCache = true,
int $criteria = Horde_Imap_Client::SYNC_NEWMSGSUIDS | Horde_Imap_Client::SYNC_FLAGSUIDS | Horde_Imap_Client::SYNC_VANISHEDUIDS): void {
$rebuildThreads = false;
$trashMailboxId = $account->getMailAccount()->getTrashMailboxId();
Expand All @@ -123,8 +122,7 @@ public function syncAccount(Account $account,
$criteria,
null,
$force,
true,
$useClientCache,
true
)) {
$rebuildThreads = true;
}
Expand Down Expand Up @@ -195,14 +193,13 @@ public function sync(Account $account,
int $criteria = Horde_Imap_Client::SYNC_NEWMSGSUIDS | Horde_Imap_Client::SYNC_FLAGSUIDS | Horde_Imap_Client::SYNC_VANISHEDUIDS,
?array $knownUids = null,
bool $force = false,
bool $batchSync = false,
bool $useClientCache = true): bool {
bool $batchSync = false): bool {
$rebuildThreads = true;
if ($mailbox->getSelectable() === false) {
return $rebuildThreads;
}

$client = $this->clientFactory->getClient($account, $useClientCache);
$client = $this->clientFactory->getClient($account);
$client->login(); // Need to login before fetching capabilities.

// There is no partial sync when using QRESYNC. As per RFC the client will always pull
Expand Down

0 comments on commit 84d72f9

Please sign in to comment.