Working on something similar?
I take on a few projects at a time. Get in touch and we can see if it is a fit.
I take on a few projects at a time. Get in touch and we can see if it is a fit.
Lessons from shipping an inspection app used in basements, tunnels and rural sites. Sync conflicts, photo uploads and the UX of not knowing whether you are online.
"It should work offline" is one line in a requirements document and about a third of the engineering effort. Here is what went wrong on a field inspection app before it went right.
Devices report "online" while sitting on a cellular connection that cannot complete a 2 MB upload. Treating connectivity as true | false produced spinners that never ended.
What worked:
Two technicians editing the same inspection is rare. One technician editing the same inspection on two devices is not. We settled on:
Do not build a general CRDT engine for a checklist app. Pick rules per field type and write them down.
Text syncs in milliseconds. Photos are where the app lives or dies.
Future<void> drain() async {
for (final job in await store.pending()) {
try {
await uploader.send(job, compress: true);
await store.markDone(job.id);
} on TransientError {
break; // keep order, retry later with backoff
}
}
}Compress on device, upload in order, and never block the UI on it.
Marco Restif
Software engineer · AI & full-stack. Writing about what I build.
Transforming Push Notifications into a Premium Brand Experience: a combination of design and automation