Service Layer high complexity mobile
2
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Handles merge conflicts that arise when the same record is modified both on the device and on the server before sync occurs. Applies deterministic, entity-specific strategies - last-write-wins for simple scalar fields and field-level merging for complex entities - to preserve data integrity without requiring user intervention.

Feature: Offline Data Support

conflict-resolution-service

Responsibilities

  • Detect conflicts by comparing server and local timestamps and version vectors
  • Apply last-write-wins strategy for activity duration, date, and status fields
  • Apply field-level merge for contact and caregiver records to avoid data loss
  • Log all conflict resolutions to audit trail for coordinator review
  • Expose conflict summary for optional user notification on resolution

Interfaces

resolveActivity(Activity local, Activity remote): Activity
resolveContact(Contact local, Contact remote): Contact
detectConflict(SyncRecord local, SyncRecord remote): bool
getResolutionLog(): List<ConflictResolutionRecord>

Relationships

Dependencies (2)

Components this component depends on