3.1.5.6.1 Detection

Servers MUST implement conflict detection using an algorithm that provides the same output as the one described in this section.

Servers MUST perform conflict detection on ICS uploads for versions of messaging objects stored in a server replica and passed by the client through the RopSynchronizationImport* ROPs.

Conflict detection is performed by examining the PidTagPredecessorChangeList properties (section 2.2.1.2.8) for objects that have the same value for the PidTagSourceKey property (section 2.2.1.2.5).

Clients can perform conflict detection during ICS download for versions of objects stored in a local replica and passed by the server in a FastTransfer stream.

To illustrate the use of PCLs in conflict detection, the following algorithm uses sample PCLs (PCLA and PCLB) to detect a conflict between two versions of the same messaging object.

Conflict Detection Algorithm

PCLA includes PCLB if and only if for every XID structure, as specified in section 2.2.2.2, in PCLB there is an XID structure in PCLA that has a NamespaceGuid field with the same value, and the same or greater value for the LocalId field. The notation PCLA ≥ PCLB is used if PCLA includes or is equal to PCLB.

If a change to a messaging object is being synchronized from replica A to replica B, use the following statements to identify the conflict and the version to replicate:

  1. If PCLA includes PCLB, then the version from replica A is newer and replaces the version in replica B.

  2. If PCLB includes or is equal to PCLA, then the version from replica A is older, and is ignored. The version in replica B remains intact.

  3. If neither 1 nor 2 is true, then versions from replicas A and B are in conflict.

Servers can create and implement additional conflict detection mechanisms, as long as PCLs for object versions that do and do not conflict adhere to these criteria.

The following figure shows how to detect a synchronization conflict when comparing the PidTagPredecessorChangeList property (section 2.2.1.2.8).

Conflict details

Figure 2: Conflict details

The figure simplifies the contents of the PCL to focus on the comparison. Each CN structure, as specified in section 2.2.2.1, within the PCL in the figure is represented by a letter (A for server changes, and B for client changes) and an increasing number.

The server-side PCL is missing a B2 change, while the client side PCL is missing A2; therefore, each has changes the other has not seen, and thus these modifications are conflicting.

The following sections describe the details of synchronization when detecting conflicting changes.