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

Description

Manages the lifecycle of client-generated temporary UUIDs (v4) used for offline-created entities. Once the server confirms entity creation it back-patches the permanent server-assigned ID across all local foreign key references in a single Drift transaction.

Feature: Offline Data Support

id-mapping-service

Responsibilities

  • Generate UUID v4 temporary IDs for entities created while offline
  • Persist temp-ID-to-server-ID mappings in the local ID mapping table
  • Back-patch permanent IDs across all foreign key references on server confirmation
  • Clean up resolved mappings after successful sync

Interfaces

generateTempId(): String
registerMapping(tempId, serverAssignedId, entityType): Future<void>
resolveId(tempId): Future<String?>
backPatchReferences(tempId, permanentId): Future<void>
getPendingMappings(): Future<List<IdMapping>>

Relationships

Dependencies (2)

Components this component depends on

Related Data Entities (2)

Data entities managed by this component