ID Mapping Service
Component Detail
Service Layer
high complexity
mobile
1
Dependencies
1
Dependents
3
Entities
0
Integrations
Description
Manages the lifecycle of client-side UUIDs assigned to entities created while offline and reconciles them to server-assigned IDs after a successful sync. Rewrites all local references so relational integrity is preserved across the sync boundary.
id-mapping-service
Sources & reasoning
Offline-created entities need stable local IDs before the server has seen them. When an activity references an offline-created contact, both records must be created in order on the server and all local references rewritten to server IDs - without this service, relational integrity breaks at sync time.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Generate stable client-side UUIDs for entities created while offline
- Persist local-to-server ID mappings in the encrypted local database
- Rewrite outbox mutation payloads with resolved server IDs before replay
- Clean up resolved mappings after server confirmation
Interfaces
generateLocalId(): String
registerMapping(localId: String, serverId: String): Future<void>
resolveId(localId: String): Future<String?>
applyMappings(mutations: List<OutboxMutation>): Future<List<OutboxMutation>>
Relationships
Dependencies (1)
Components this component depends on
Related Data Entities (3)
Data entities managed by this component