diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-03-29 18:23:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 18:23:24 +0300 |
commit | 7a51a14e9f04c993b664cb5b4fe673fe75258b14 (patch) | |
tree | c1d8d4c2a74ce70bf4d8da0953d77e09234367d3 /lib/Service | |
parent | b10748ed7b8c3f74ba0b977cc2d144ad1928a865 (diff) | |
parent | ef34b03c17331bdbabaf0cfa27d2537e76156647 (diff) |
Merge pull request #4765 from nextcloud/fix/initial-sync-lock-full-mailbox
Lock the full mailbox when doing a (forced) initial sync
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/Sync/ImapToDbSynchronizer.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Service/Sync/ImapToDbSynchronizer.php b/lib/Service/Sync/ImapToDbSynchronizer.php index 2adba1ee2..b0ceed980 100644 --- a/lib/Service/Sync/ImapToDbSynchronizer.php +++ b/lib/Service/Sync/ImapToDbSynchronizer.php @@ -197,15 +197,15 @@ class ImapToDbSynchronizer { return; } - if ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS) { + if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) { $logger->debug("Locking mailbox " . $mailbox->getId() . " for new messages sync"); $this->mailboxMapper->lockForNewSync($mailbox); } - if ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS) { + if ($force || ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS)) { $logger->debug("Locking mailbox " . $mailbox->getId() . " for changed messages sync"); $this->mailboxMapper->lockForChangeSync($mailbox); } - if ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS) { + if ($force || ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS)) { $logger->debug("Locking mailbox " . $mailbox->getId() . " for vanished messages sync"); $this->mailboxMapper->lockForVanishedSync($mailbox); } @@ -241,15 +241,15 @@ class ImapToDbSynchronizer { } catch (Throwable $e) { throw new ServiceException('Sync failed for ' . $account->getId() . ':' . $mailbox->getName() . ': ' . $e->getMessage(), 0, $e); } finally { - if ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS) { + if ($force || ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS)) { $logger->debug("Unlocking mailbox " . $mailbox->getId() . " from vanished messages sync"); $this->mailboxMapper->unlockFromVanishedSync($mailbox); } - if ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS) { + if ($force || ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS)) { $logger->debug("Unlocking mailbox " . $mailbox->getId() . " from changed messages sync"); $this->mailboxMapper->unlockFromChangedSync($mailbox); } - if ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS) { + if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) { $logger->debug("Unlocking mailbox " . $mailbox->getId() . " from new messages sync"); $this->mailboxMapper->unlockFromNewSync($mailbox); } |