Conflict Resolver Service
Component Detail
Service Layer
high complexity
mobile
2
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Resolves conflicts when the same record was mutated both offline and on the server. Applies entity-scoped strategies: server-wins for activities and notes (authoritative for Bufdir reporting), last-write-wins with timestamp comparison for contact edits.
conflict-resolver-service
Responsibilities
- Detect conflicts by comparing local mutation timestamps against server record versions
- Apply server-wins strategy for activities and notes on conflict
- Apply last-write-wins with timestamp comparison for contact edits
- Persist resolution outcome and update local store to authoritative state
- Emit conflict resolution events to the Riverpod state layer for UI notification
Interfaces
resolve(entityType, localRecord, serverRecord): Future<ConflictResolution>
getStrategy(entityType): ConflictStrategy
applyResolution(resolution): Future<void>
Relationships
Dependencies (2)
Components this component depends on
Related Data Entities (2)
Data entities managed by this component