Skip to content

fix(activesync): complete account-only remote wipe per user#62

Merged
TDannhauer merged 2 commits into
FRAMEWORK_6_0from
fix/account-only-remote-wipe
Jun 21, 2026
Merged

fix(activesync): complete account-only remote wipe per user#62
TDannhauer merged 2 commits into
FRAMEWORK_6_0from
fix/account-only-remote-wipe

Conversation

@TDannhauer

@TDannhauer TDannhauer commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add per-user device_accountonly_rwstatus storage (migration 25) so account-only wipe works when multiple accounts share one device ID
  • Fix provision loop: acknowledge wipe with minimal response, set ACCOUNTONLY_WIPED, and only send AccountOnlyRemoteWipe while status is pending
  • Block sync/foldersync with status 142 after wipe and reject further provisioning for wiped accounts

Test plan

  • Run ActiveSync unit tests
  • Apply migration 25 on SQL/Mongo backends
  • Trigger account-only wipe for one user on a multi-account iPhone; verify single wipe command, client ack, sync blocked (142), other account unaffected
  • Confirm admin shows account-only wiped status until device state is removed

Store account-only wipe status per device user, stop the provision
loop after client ack, block sync for wiped accounts, and reject
further provisioning so iOS does not receive new policy keys.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ActiveSync remote-wipe handling so account-only remote wipe is tracked per device user (not per device ID), enabling correct behavior when multiple accounts share the same device ID.

Changes:

  • Add per-user device_accountonly_rwstatus storage (SQL migration + SQL/Mongo state support) and expose it via new state APIs.
  • Adjust Provision / policy-key enforcement so account-only wipe is acknowledged with a minimal response, only sent while pending, and blocks subsequent sync via provisioning-required responses.
  • Update long-polling (PING) change detection to consider the new per-user account-only wipe status.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
migration/Horde/ActiveSync/25_horde_activesync_peruser_accountonly_rwstatus.php Adds per-user SQL column and clears legacy device-level account-only wipe states.
lib/Horde/ActiveSync/State/Sql.php Loads/stores per-user account-only wipe status and adds setter API.
lib/Horde/ActiveSync/State/Mongo.php Stores/loads per-user account-only wipe status in Mongo device user subdocuments.
lib/Horde/ActiveSync/State/Base.php Adds getAccountOnlyRWStatus() and new abstract setter for account-only wipe status.
lib/Horde/ActiveSync/Request/Provision.php Updates Provision flow to handle account-only wipe pending/ack/wiped behavior.
lib/Horde/ActiveSync/Request/Base.php Enforces provisioning-required responses for account-only pending/wiped states.
lib/Horde/ActiveSync/Collections.php Makes PING change polling treat account-only wipe as requiring FolderSync.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Horde/ActiveSync/State/Sql.php
Comment thread lib/Horde/ActiveSync/State/Base.php
Comment thread lib/Horde/ActiveSync/State/Sql.php
Comment thread lib/Horde/ActiveSync/State/Mongo.php
Initialize per-user row data before loadDeviceInfo() reads account-only
status, normalize getAccountOnlyRWStatus() to RWSTATUS_NA, reject
account-only constants in setDeviceRWStatus(), and add SQLite unit tests
for the per-user wipe lifecycle.
@TDannhauer TDannhauer merged commit 0f1bc54 into FRAMEWORK_6_0 Jun 21, 2026
0 of 4 checks passed
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