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
ralflang added a commit that referenced this pull request Nov 13, 2026
Release version 3.3.0

fix(activesync): log failed state saves through the ActiveSync logger
fix(activesync): keep sync state of two devices apart after a device change
Merge pull request #114 from horde/docs/todo-spl-exception-classification
docs(activesync): note SPL-based exception classification as 6.1 follow-up
feat(activesync): let backends set the per-item status of a failed change
fix(activesync): read meeting requests with the Horde\Icalendar reader
fix(activesync): hold no DB transaction across backend calls in State_Sql
Merge pull request #107 from horde/feat/ops-health-evaluator
Merge pull request #106 from horde/fix/activesync-ghost-fsr-and-backlog-health
docs(activesync): plan the typed collection object
chore(activesync): require PHP 8.1
fix(ops): type collection snapshots and match constructor arity
Merge pull request #108 from horde/docs/ops-monitor
feat(ops): add ActiveSync health evaluation
docs(ops): document ActiveSync operations monitor
fix(activesync): heal ghost collections instead of FolderSync loops
fix(search): finish Gmail Search documents before the client gives up
feat(search): stream mailbox Search to survive Gmail's 30s timeout
feat(activesync): force Sync TruncationSize override
Merge pull request #98 from horde/fix/bogus-binary-size-and-clients
feat(sync): recover undrained MOREAVAILABLE backlogs via PING
fix(ping): send Status 1 instead of an empty body on stale-cache exit
fix(activesync): address review on BINARY.SIZE size handling
docs(activesync): record Gmail/Nine/iOS body truncation behaviour
fix(activesync): ignore bogus BINARY.SIZE in body part size
fix(sync): sweep pre-existing \Deleted messages once per folder
fix(sync): ignore read state in draft no-op comparison
fix(sync): skip no-op draft rewrites and treat \Deleted as removed
fix(sync): apply all InstanceId removes for a recurring series
fix(sync): export draft changes under the client's ServerId
docs(activesync): document FRAMEWORK_6_1 src-first refactor approach
chore(activesync): enable Sync streaming by default and close #83
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