feat(core): implement ActiveSync status prefetch and bulk message fetch#212
Merged
Merged
Conversation
Implement the optional batching hooks from horde/ActiveSync#88 in Horde_Core_ActiveSync_Driver: - prefetchFolderStatus() delegates to Imap_Adapter::prefetchStatus() for a single LIST-STATUS round trip covering all pinged mail folders. - getMessagesBulk() fetches a batch of email messages in one IMAP fetch sequence and shares post-processing with getMessage() via the extracted _postProcessMailMessage() helper (last-verb lookup, draft flag, iTip response import). Non-email folders, missing ids, and backend errors fall back to the per-item calls with unchanged error semantics. Refs horde/ActiveSync#88
ralflang
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RFC: Email sync performance — heartbeat loop state reloads, SyncCache writes, export batching ActiveSync#88 in
Horde_Core_ActiveSync_Driver:prefetchFolderStatus()andgetMessagesBulk().Motivation
The heartbeat/PING loop issued one IMAP STATUS round trip per pinged
mail folder per poll iteration, and message export fetched every email
individually (N+1). The library-side changes (companion PR horde/ActiveSync#91) call these new optional driver hooks; this PR provides
the IMAP-backed implementation. See horde/ActiveSync#88 for the analysis
and the full plan.
Changes
prefetchFolderStatus()filters email folders (dropsOUTBOX,requires at least two mailboxes) and delegates to
Horde_ActiveSync_Imap_Adapter::prefetchStatus()— a singlemulti-mailbox STATUS request (one LIST-STATUS round trip on servers
that support RFC 5819). Failures are logged as a notice and polling
falls back to per-mailbox STATUS.
getMessagesBulk()fetches a batch of email messages with oneImap_Adapter::getMessages()call (keyed by UID) and applies the samepost-processing as
getMessage()via the extracted_postProcessMailMessage()helper (last-verb lookup, draft flag, iTipresponse import). Non-email folders return an empty array (caller
falls back per item); errors are logged as a notice and also fall
back.
getMessage()email branch now uses_postProcessMailMessage()—behaviour unchanged, logic shared.
Expected exceptions in new catch blocks:
Horde_Exception(statusprefetch),
Horde_Exception/Horde_ActiveSync_Exception(bulk fetch).Test plan
companion horde/ActiveSync PR (bulk consumption, per-id fallback,
no-bulk equivalence).
logs, exports clean, no errors.