Skip to content

fix(activesync): report no folder changes when getFolderList() is false#79

Merged
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/foldersync-empty-folderlist-guard
Jul 8, 2026
Merged

fix(activesync): report no folder changes when getFolderList() is false#79
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/foldersync-empty-folderlist-guard

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Initialize $this->_changes to [] when a backend's getFolderList() returns false, so the documented "skip folder listing" contract does not leave _changes null.

Motivation

getFolderList() is allowed to return false to 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 subsequent count($this->_changes) (via getChangeCount() or the FolderSync exporter) fatals under PHP 8's stricter count().

Changes

  • Horde_ActiveSync_State_Base::_getFolderChanges(): set $this->_changes = [] before returning on the getFolderList() === false path.

Test plan

  • A backend returning false from getFolderList() produces a FOLDERSYNC with zero changes and unchanged synckey (no fatal).
  • Normal folder change detection is unaffected.

_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.
@TDannhauer
TDannhauer requested a review from ralflang July 8, 2026 06:26
@TDannhauer
TDannhauer merged commit e78e75d into FRAMEWORK_6_0 Jul 8, 2026
1 check failed
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔍 CI Results

Overall: ❌ 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

PHP dev stable
8.0
8.1
8.2
8.3
8.4
8.5

Quality Metrics

  • PHPUnit: 16 failures, 20 errors out of 205 tests in 8 lanes ❌
    Per-test detail in the table below. Raw JUnit XML and JSON are uploaded as workflow artifacts.

    Which tests failed
    Type Test Lanes Message
    ❌ failure Horde\ActiveSync\AppointmentTest::testSetRecurrenceEas16SetsFirstDayOfWeek php8.2-dev, php8.2-stable, php8.3-dev, php8.3-stable, php8.4-dev, php8.4-stable, php8.5-dev, php8.5-stable [PHPUnit\Framework\ExpectationFailedException] Failed asserting that '' matches expected 0.
    ⚠️ error Horde\ActiveSync\Request\FindRequestTest::testMockDriverReturnsSuccessfulEmptyFindResults php8.2-dev, php8.2-stable, php8.3-dev, php8.3-stable, php8.4-dev, php8.4-stable, php8.5-dev, php8.5-stable [InvalidArgumentException] Missing required state object
    ❌ failure Horde\ActiveSync\Request\FindRequestTest::testParseFindRangeHonorsClientWindow php8.2-dev, php8.2-stable, php8.3-dev, php8.3-stable, php8.4-dev, php8.4-stable, php8.5-dev, php8.5-stable [PHPUnit\Framework\ExpectationFailedException] Failed asserting that 100 is identical to 101.
    ⚠️ error Horde\ActiveSync\SyncTimeBudgetTest::testGetSyncConfigDefaultsToEmptyArray php8.3-dev, php8.3-stable, php8.4-dev, php8.4-stable, php8.5-dev, php8.5-stable [Error] Call to undefined method PHPUnit\Framework\MockObject\MockBuilder::getMockForAbstractClass()
    ⚠️ error Horde\ActiveSync\SyncTimeBudgetTest::testGetSyncConfigReturnsConfiguredValues php8.3-dev, php8.3-stable, php8.4-dev, php8.4-stable, php8.5-dev, php8.5-stable [Error] Call to undefined method PHPUnit\Framework\MockObject\MockBuilder::getMockForAbstractClass()
  • PHPStan (advisory): 331 unique errors in 8 lanes ⚠️

  • PHP-CS-Fixer: 18 unique files with issues (of 197 checked) ⚠️

❌ Failed Lanes

php8.0-dev

  • PHPUnit: ❌ Setup failed (No result file found)
  • PHPStan: ❌ Setup failed (No result file found)

php8.0-stable

  • PHPUnit: ❌ Setup failed (Composer install failed in /tmp/horde-ci/lanes/php8.0-stable/ActiveSync: Your requirements could not be resolved to an installable set of packages.)
  • PHPStan: ❌ Setup failed (Composer install failed in /tmp/horde-ci/lanes/php8.0-stable/ActiveSync: Your requirements could not be resolved to an installable set of packages.)

php8.1-dev

  • PHPUnit: ❌ Setup failed (No result file found)
  • PHPStan: ❌ Setup failed (No result file found)

php8.1-stable

  • PHPUnit: ❌ Setup failed (No result file found)
  • PHPStan: ❌ Setup failed (No result file found)

php8.2-dev

  • PHPUnit: 2 failures, 1 error

php8.2-stable

  • PHPUnit: 2 failures, 1 error

php8.3-dev

  • PHPUnit: 2 failures, 3 errors

php8.3-stable

  • PHPUnit: 2 failures, 3 errors

php8.4-dev

  • PHPUnit: 2 failures, 3 errors
  • PHP-CS-Fixer: 18 files with issues

php8.4-stable

  • PHPUnit: 2 failures, 3 errors

php8.5-dev

  • PHPUnit: 2 failures, 3 errors

php8.5-stable

  • PHPUnit: 2 failures, 3 errors

CI powered by horde-componentsView 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()
@TDannhauer
TDannhauer deleted the fix/foldersync-empty-folderlist-guard branch July 10, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant