Fix/activesync for kronolith#35
Open
TDannhauer wants to merge 2 commits into
Open
Conversation
Removed redundant endTag call in FolderCreate.php.
traverse the right logic path
7 tasks
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 FolderDelete state and WBXML handling
Summary
FolderDeleteas a client-originated change when updating folder state.null.endTag()from the FolderCreate/FolderUpdate/FolderDelete request handler.Problem
iOS
FolderDeletecompleted successfully at the protocol level, but Horde logged PHP warnings during the request:foreach() argument must be of type array|object, null giveninHorde_ActiveSync_State_Sql::updateState()Trying to access array offset on nullinHorde_ActiveSync_Wbxml_Encoder::endTag()The first warning came from
Horde_ActiveSync_Connector_Importer::importFolderDeletion(). FolderDelete is initiated by the client, but the importer updated state withCHANGE_ORIGIN_NA. That sent SQL state handling down the server-change path, where_changescan benullfor this request.The second warning came from
Horde_ActiveSync_Request_FolderCreate, which handles FolderCreate, FolderUpdate, and FolderDelete responses. Each branch already opens and closes its own root response tag, but the method had one additional unconditionalendTag()after the branch. For FolderDelete this popped an empty encoder stack after a valid response had already been produced.Solution
Horde_ActiveSync_Connector_Importer::importFolderDeletion()now callsupdateState()withCHANGE_ORIGIN_PIM.That matches the actual origin of FolderDelete, avoids the wrong server-change bookkeeping path, and prevents the
foreach()warning in SQL state handling.Horde_ActiveSync_Request_FolderCreateno longer emits the extra unconditionalendTag()after the create/update/delete branch. The response branch remains responsible for closing the root response tag it opened.Files changed
vendor/horde/activesync/lib/Horde/ActiveSync/Connector/Importer.phpvendor/horde/activesync/lib/Horde/ActiveSync/Request/FolderCreate.phpValidation
php -lcompleted successfully for the edited ActiveSync PHP files.Test plan
1./tmp-horde/horde.log; confirm no warning fromHorde_ActiveSync_State_Sql::updateState()during FolderDelete./tmp-horde/horde.log; confirm no warning fromHorde_ActiveSync_Wbxml_Encoder::endTag()during FolderDelete.Notes
This change is intentionally protocol-level and application-neutral. It does not change how Kronolith, Nag, Turba, or Mnemo create/delete their folders; it only fixes common ActiveSync FolderDelete state and response handling.