Skip to content

fix(activesync): heal ghost collections instead of FolderSync loops - #106

Merged
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/activesync-ghost-fsr-and-backlog-health
Sep 28, 2026
Merged

TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/activesync-ghost-fsr-and-backlog-health

Conversation

@TDannhauer

@TDannhauer TDannhauer commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Self-heal collections that have a synckey but no folders[] cache entry, instead of answering PING with Status 7.

Motivation

Incremental FolderSync cannot repair that cache skew: a valid hierarchy synckey yields Count 0. Cooperating clients then repeat empty PING → Status 7 → FolderSync indefinitely.

Changes

  • healCollectionsMissingFolderCache() restores a missing folders row from the persistent foldermap, or drops the collection when it is a true ghost.
  • collectionsNeedFolderResync() now runs that heal and returns false. Missing hierarchy is still handled via haveHierarchy().
  • Empty / cached PING paths call the heal before deciding on FolderSync.
  • Unit tests for drop, foldermap restore, and leaving healthy collections untouched.

Test plan

  • PHPUnit: CollectionsGhostFolderCacheTest, BacklogPingRecoveryTest, PingCollectionLockContentionTest
  • Empty PING with a ghost collection: log shows restore or drop; response is Status 1/2 rather than Status 7
  • Incremental FolderSync is not required for this skew and does not loop

@TDannhauer
TDannhauer requested a review from ralflang September 18, 2026 21:24
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

🔍 CI Results

Overall: ❌ 12/12 lanes failed

TL;DR: ❌ Quality issues: PHPStan: 245 unique errors in 11 lanes; PHP-CS-Fixer: 35 files.

Summary by PHP Version

PHP dev stable
8.0 ❌ ❌
8.1 ❌ ❌
8.2 ❌ ❌
8.3 ❌ ❌
8.4 ❌ ❌
8.5 ❌ ❌

Quality Metrics

  • PHPUnit: did not run (11 lanes exited non-zero with no test output) ❌
  • PHPStan (advisory): 245 unique errors in 11 lanes ⚠️
  • PHP-CS-Fixer: 35 unique files with issues (of 217 checked) ⚠️
❌ Failed Lanes

php8.0-dev

  • PHPUnit: 0 failures, 0 errors

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: 0 failures, 0 errors

php8.1-stable

  • PHPUnit: 0 failures, 0 errors

php8.2-dev

  • PHPUnit: 0 failures, 0 errors

php8.2-stable

  • PHPUnit: 0 failures, 0 errors

php8.3-dev

  • PHPUnit: 0 failures, 0 errors

php8.3-stable

  • PHPUnit: 0 failures, 0 errors

php8.4-dev

  • PHPUnit: 0 failures, 0 errors
  • PHP-CS-Fixer: 35 files with issues

php8.4-stable

  • PHPUnit: 0 failures, 0 errors

php8.5-dev

  • PHPUnit: 0 failures, 0 errors

php8.5-stable

  • PHPUnit: 0 failures, 0 errors

CI powered by horde-components • View full results

Collections with a synckey but no folders cache entry cannot be repaired
by incremental FolderSync (Count 0). PING Status 7 then livelocks
cooperating clients. Restore the folders row from foldermap, or drop the
ghost collection, instead of requesting FolderSync.
@TDannhauer
TDannhauer force-pushed the fix/activesync-ghost-fsr-and-backlog-health branch from f0c983e to 6bbd08f Compare September 18, 2026 21:31
@TDannhauer TDannhauer changed the title fix(activesync): heal ghost collections and abandon exhausted backlogs fix(activesync): heal ghost collections instead of FolderSync loops Sep 18, 2026
@TDannhauer
TDannhauer merged commit fba114f into FRAMEWORK_6_0 Sep 28, 2026
1 check failed
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