Skip to content

fix(activesync): guard empty OOF messages in Settings response#82

Merged
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/settings-oof-empty-msgs
Jul 13, 2026
Merged

fix(activesync): guard empty OOF messages in Settings response#82
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/settings-oof-empty-msgs

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Handle empty oofmsgs in Horde_ActiveSync_Request_Settings::_getOofObject() when building OOF Settings responses
  • Return disabled OOF defaults instead of accessing oofmsgs[0] on PHP 8+
  • Add unit tests for empty and configured OOF message payloads

Motivation

Android Gmail issues Settings:Oof Get during ActiveSync setup/sync. When no vacation filter is configured, Horde_Core_ActiveSync_Driver::getSettings() returns 'oofmsgs' => []. The Settings handler then hit:

  • Undefined array key 0
  • Trying to access array offset on null

This was observed in logs for #77.

Changes

  • lib/Horde/ActiveSync/Request/Settings.php: safely read oofmsgs and fall back to disabled defaults
  • test/unit/Horde/ActiveSync/Request/SettingsRequestTest.php: cover empty and populated oofmsgs

Test plan

  • vendor/bin/phpunit -c phpunit.xml.dist test/unit/Horde/ActiveSync/Request/SettingsRequestTest.php
  • Retest Gmail Settings:Oof Get against an account without vacation filter; confirm no PHP warnings in Horde log

Made with Cursor

Gmail queries Settings:Oof Get during sync. When no vacation filter
is configured the driver returns an empty oofmsgs array; accessing
index 0 triggered PHP 8 warnings. Return disabled defaults instead.
@TDannhauer
TDannhauer merged commit 12a0fc3 into FRAMEWORK_6_0 Jul 13, 2026
1 check failed
@github-actions

Copy link
Copy Markdown

🔍 CI Results

Overall: ❌ 12/12 lanes failed

TL;DR: ❌ Quality issues: PHPUnit: 54 tests failed; PHPStan: 331 unique errors in 8 lanes; PHP-CS-Fixer: 20 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, 38 errors out of 212 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\FolderUidDeterministicTest::testFolderUidIsDeterministicAcrossDriverInstances 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\FolderUidDeterministicTest::testFolderUidIsDeterministicForRepeatedLookups 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\FolderUidDeterministicTest::testFolderUidUsesPersistedMapWhenPresent 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\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: 20 unique files with issues (of 200 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, 6 errors

php8.3-stable

  • PHPUnit: 2 failures, 6 errors

php8.4-dev

  • PHPUnit: 2 failures, 6 errors
  • PHP-CS-Fixer: 20 files with issues

php8.4-stable

  • PHPUnit: 2 failures, 6 errors

php8.5-dev

  • PHPUnit: 2 failures, 6 errors

php8.5-stable

  • PHPUnit: 2 failures, 6 errors

CI powered by horde-componentsView full results

ralflang added a commit that referenced this pull request Jul 18, 2026
Release version 3.1.0

fix(sync): emit SYNC_MODIFY replies for EAS 16 email modifies
fix(activesync): throttle deferred-import keep-alive tokens
fix(activesync): address streaming review findings
docs(activesync): restructure documentation by audience
feat(activesync): defer up-sync imports and emit WBXML keep-alives when streaming
docs(activesync): note batch-size vector consolidation for Horde 6
feat(activesync): stream Sync responses incrementally
Merge pull request #82 from horde/fix/settings-oof-empty-msgs
fix(activesync): guard empty OOF messages in Settings response
docs(todo): document folder UID map long-term work
docs(activesync): explain crc32 mask in folder UID generation
Merge pull request #81 from horde/fix/deterministic-folder-uids-moveitems-gone
Potential fix for pull request finding
Potential fix for pull request finding
Potential fix for pull request finding
fix(activesync): stabilize folder UIDs after hierarchy changes
Merge pull request #80 from horde/fix/imap-mimepart-null-charset
fix(activesync): guard null charset before strcasecmp in getMimePart()
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