Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/Horde/Imap/Client/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -3889,6 +3889,24 @@ protected function _deleteMsgs(
$mbox_ob->setStatus(Horde_Imap_Client::STATUS_SYNCVANISHED, $ids_ob->ids);
$mbox_ob->map->remove($ids);

/* The message set in this mailbox just changed (message(s)
* expunged/moved out). Any cached SEARCH results for this
* mailbox may now reference vanished UIDs, so they can no
* longer be trusted even if the tracked sync token has not
* (yet) advanced. Only touch the cache if a SEARCH was
* actually cached for this mailbox. */
$search_md = $this->_cache->getMetaData(
$mailbox,
null,
[self::CACHE_SEARCHID]
);
if (isset($search_md[self::CACHE_SEARCHID])) {
$this->_cache->setMetaData($mailbox, null, [
self::CACHE_SEARCH => [],
self::CACHE_SEARCHID => null,
]);
}

return $ids_ob;
}

Expand Down
Loading