Case Study — Anonymised, NDA · In production
Field-operations platform
iOS + Android · construction & trades industry · sole developer, end to end
- 500k+records reconciled per full sync
- 2platforms, one architecture
- 0separate mobile team — solo, end to end
Problem
Two independent sync processes — one triggered from the app in the foreground, one running as a background task — could write to the same local database at once. It only surfaced on devices with enough real data to collide over, so it passed QA clean and then corrupted state in the field.
Diagnosis
Reproduced on-device with concurrency debugging enabled, not in the simulator. Traced it to two coordinators sharing the same sync managers with no mutual exclusion between them — confirmed by forcing a foreground/background overlap and watching the crash logs line up.
Fix
A shared gate both coordinators pass through before touching the store, with priority levels so a full re-sync can still preempt routine background work instead of queuing behind it. Verified clean on device across cold-start and background-to-foreground transitions.