fix(activesync): return object-not-found for deleted ItemOperations f…#47
Open
TDannhauer wants to merge 1 commit into
Open
fix(activesync): return object-not-found for deleted ItemOperations f…#47TDannhauer wants to merge 1 commit into
TDannhauer wants to merge 1 commit into
Conversation
…etches Catch Horde_Exception_NotFound when opening search hits that were removed after Find, and respond with ItemOperations status 6 instead of HTTP 500. Fetch mailbox messages before emitting success status and folder metadata.
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.
fix(activesync): return object-not-found for deleted ItemOperations fetches
Summary
Fix
ItemOperations:Fetchfor mailbox messages so deleted or missing items return ItemOperations status 6 (Object not found) instead of propagatingHorde_Exception_NotFoundas an HTTP 500.This was observed when using EAS 16.0 Find on iOS: search hits could be opened successfully, but after deleting messages from the search results view the client issued follow-up
ItemOperationsfetches for stale IDs. The server loggedNicht gefundenand returned HTTP 500.Problem
For mailbox
ItemOperations:Fetchrequests identified byFolderId/ServerEntryIdorSearchLongId, the handler:FolderId,ServerEntryId,FolderType) before verifying the message existsHorde_Exception_NotFoundfromfetch()/getMessage()When a message had been deleted after appearing in Find results, the exception bubbled up and Horde returned HTTP 500 while the device log showed a contradictory success status followed by
ERR: Nicht gefunden.A related case involved virtual Find folder IDs (
M<uid>from iOS unified search): whenresolveLongIdForUid()could not locate the message, the code fell through togetBackendIdForFolderUid('M…'), which raisedHorde_ActiveSync_Exception_FolderGoneand produced a server error instead of a clean per-fetch not-found response.Solution
STATUS_OBJECTNOTFOUND = 6per MS-ASCMD ItemOperations status codes_fetchMailboxMessage()to centralize mailbox fetch logic with proper exception handlingHorde_Exception_NotFound→ status 6, log at INFO, skip properties encodingM<uid>folder fetches → status 6 instead of folder-gone server error_statusCodeper mailbox fetch iteration (important when multiple fetches are batched)Changes
lib/Horde/ActiveSync/Request/ItemOperations.phpSTATUS_OBJECTNOTFOUND_fetchMailboxMessage()searchlongidandfolderid/serverentryidpathsHorde_Exception_NotFound→ status 6;Horde_ActiveSync_Exception_FolderGone→ status 3M<uid>folders with no resolvable long id → status 6Unchanged: attachment (
FileReference) and document library fetch paths.Test plan
ItemOperations:Fetch(status 1)ItemOperations:Fetchreturns status 6, no HTTP 500horde.logshows INFOItemOperations fetch: message not found …, notReturning HTTP 500ERR: Nicht gefundenItemOperations:Fetchfor existing messages still worksphp -lon modified file passesRelated
Complements EAS 16.0 Find support, where
Find.phpalready skips stale hits during result encoding. This change covers the separate client path where iOS re-fetches individual messages viaItemOperationsafter search.Commit message