fix(activesync): report no folder changes when getFolderList() is false#79
Merged
Merged
Conversation
_getFolderChanges() returned early when the backend's getFolderList() returned false without initializing $this->_changes, leaving it null. A later count($this->_changes) (e.g. via getChangeCount() or the FolderSync exporter) then fatals under PHP 8. Set $this->_changes to an empty array on this path so a backend that defers folder listing (for example when the mail server is temporarily unavailable) yields a clean "no changes" FOLDERSYNC instead of a fatal error or an empty-hierarchy diff that deletes the client's folders.
🔍 CI ResultsOverall: ❌ 12/12 lanes failed TL;DR: ❌ Quality issues: PHPUnit: 36 tests failed; PHPStan: 331 unique errors in 8 lanes; PHP-CS-Fixer: 18 files. Summary by PHP Version
Quality Metrics
❌ Failed Lanesphp8.0-dev
php8.0-stable
php8.1-dev
php8.1-stable
php8.2-dev
php8.2-stable
php8.3-dev
php8.3-stable
php8.4-dev
php8.4-stable
php8.5-dev
php8.5-stable
CI powered by horde-components • View full results |
ralflang
added a commit
that referenced
this pull request
Jul 8, 2026
Release version 3.0.2 Merge pull request #79 from horde/fix/foldersync-empty-folderlist-guard fix(activesync): report no folder changes when getFolderList() is false Merge pull request #78 from horde/fix/imap-getimapob-null-guard test(activesync): cover null IMAP client ping failure fix(activesync): preserve IMAP auth exception context Update _getImapOb() docblock @throws to Horde_Exception_AuthenticationFailure fix(activesync): guard against null IMAP client in _getImapOb() fix(activesync): handle invalid appointment timezone blobs in getTimezone()
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
$this->_changesto[]when a backend'sgetFolderList()returnsfalse, so the documented "skip folder listing" contract does not leave_changesnull.Motivation
getFolderList()is allowed to returnfalseto signal "cannot produce a folder list right now" (e.g. a temporarily unavailable mail backend)._getFolderChanges()honored the early-out but never set$this->_changes, so a subsequentcount($this->_changes)(viagetChangeCount()or the FolderSync exporter) fatals under PHP 8's strictercount().Changes
Horde_ActiveSync_State_Base::_getFolderChanges(): set$this->_changes = []before returning on thegetFolderList() === falsepath.Test plan
falsefromgetFolderList()produces a FOLDERSYNC with zero changes and unchanged synckey (no fatal).