Skip to content

Activesync fixes#12

Merged
amulet1 merged 4 commits intohorde:FRAMEWORK_6_0from
amulet1:activesync_fixes
Mar 11, 2026
Merged

Activesync fixes#12
amulet1 merged 4 commits intohorde:FRAMEWORK_6_0from
amulet1:activesync_fixes

Conversation

@amulet1
Copy link
Collaborator

@amulet1 amulet1 commented Mar 10, 2026

Remove range usage and harden SEARCH_AND in _doQuery()

  • Remove erroneous $range parameter from recursive SEARCH_AND call and
    eliminate (a non-working) per-mailbox range slicing, as range handling
    belongs (and is already done) at the caller level. Add explicit validation
    to SEARCH_AND unwrapping.

Remove reference return from __get() magic method in Horde_ActiveSync_Message_Base

Harden WBXML decoder against false/empty element checks (to be continued)

  • Replace empty()/loose-equality checks with strict !== false comparisons
  • Fix getElement() logic: return element directly for start/end tags,
    only loop for content concatenation; eliminates spurious return false
  • Add missing return false at end of _getToken() (potential null return bug)
  • Fix typo: "memeory" -> "memory" in comment
  • Update @return docblocks to reflect array|boolean return types

Overhaul Search request handling with proper range validation and status codes

  • Add STORE_STATUS_RANGEERR (12) constant per MS-ASCMD spec
  • Add default case to search name switch; return STORE_STATUS_PROTERR for
    unknown store types
  • Add per-type max results limits (mailbox/GAL: 100, documentlibrary: 1000)
  • Move range parsing out of query map into dedicated $range variable;
    validate format and enforce max results ceiling, returning RANGEERR (12) if exceeded
    [this also fixes issue with caching done by getSearchResults()];
  • Fix mailbox/documentlibrary error status: PROTERR instead of FOLDERSYNC
  • Move pagination (array_slice) from driver into request handler; driver
    now returns full result set, caller owns slicing
  • Replace search_result['rows']/['total'] envelope with flat $rows/$total
  • Simplify output loop: drop manual $count, derive search_range from
    $start + count($rows)
  • Gate backend call behind $store_status === SUCCESS check

IMPORTANT: This is required by and relies on changes in horde/Core#57.

amulet1 added 4 commits March 9, 2026 12:52
Remove erroneous $range parameter from recursive SEARCH_AND call and
eliminate (a non-working) per-mailbox range slicing, as range handling
belongs (and is already done) at the caller level. Add explicit validation
to SEARCH_AND unwrapping.

Further cleanup and incremental improvements are needed.
- Replace empty()/loose-equality checks with strict !== false comparisons
- Fix getElement() logic: return element directly for start/end tags,
  only loop for content concatenation; eliminates spurious `return false`
- Add missing `return false` at end of _getToken() (potential null return bug)
- Fix typo: "memeory" -> "memory" in comment
- Update @return docblocks to reflect array|boolean return types

To be continued.
…nge validation and status codes

- Add STORE_STATUS_RANGEERR (12) constant per MS-ASCMD spec
- Add default case to search name switch; return STORE_STATUS_PROTERR for
  unknown store types
- Add per-type maxResults limits (mailbox/GAL: 100, documentlibrary: 1000)
- Move range parsing out of query map into dedicated $range variable;
  validate format and enforce maxResults ceiling, returning RANGEERR (12) if exceeded
  [this also fixes issue with caching done by getSearchResults()];
- Fix mailbox/documentlibrary error status: PROTERR instead of FOLDERSYNC
- Move pagination (array_slice) from driver into request handler; driver
  now returns full result set, caller owns slicing
- Replace search_result['rows']/['total'] envelope with flat $rows/$total
- Simplify output loop: drop manual $count, derive search_range from
  $start + count($rows)
- Gate backend call behind $store_status === SUCCESS check
@amulet1 amulet1 self-assigned this Mar 11, 2026
@amulet1 amulet1 merged commit 3818308 into horde:FRAMEWORK_6_0 Mar 11, 2026
0 of 8 checks passed
@amulet1 amulet1 deleted the activesync_fixes branch March 11, 2026 11:51
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.

2 participants