How offline capture and sync work
When the app cannot reach the server, it writes the punch to local storage: employee ID, device clock time, the last known GPS fix and its accuracy, the selfie or face-match result, and a device-generated sequence number. The employee sees a 'saved, will sync' message rather than an error. When connectivity returns – even hours later – the queue uploads in order and the server stores each punch with its captured timestamp.
Two safeguards matter. First, the app should use a trusted time source where possible and record the device clock offset, so a phone with a deliberately wrong clock can be identified. Second, the queue must survive the app being closed or the phone being restarted; a punch lost in a crash is the worst outcome because the employee believes it was recorded.
Conflict and validation rules
Offline punches arrive late, so the server must apply the same rules it would have applied live: was the captured time inside the shift window, was the location inside the geofence, does the punch sequence make sense (an 'out' before an 'in' is a flag). If the employee also punched from another device while offline, the server keeps both and marks the duplicate for review rather than silently overwriting.
Set a maximum sync delay for payroll-sensitive punches. A punch synced 15 minutes late is normal; one synced three days later, on the last day of the month, deserves a supervisor's look before it counts. Route those through regularization so the audit trail shows why it was accepted.
- Store captured time, not sync time, as the punch time
- Record GPS accuracy with the fix; a stale or 500-metre fix should be visible
- Keep the offline queue in durable storage that survives restarts
- Flag punches synced after a threshold you choose (for example 24 hours)
- Apply shift, grace and geofence rules on sync exactly as for live punches
Where it matters in India
Parking basements in malls, cold storages, rural warehouses, highway toll plazas, hill-station resorts and half the construction sites in the country have patchy or no data signal at the punch point. Guards on 12-hour night posts often sit in exactly these spots. Without offline mode, either the guard walks to find signal – leaving the post – or the supervisor 'adjusts' attendance later on WhatsApp, and you are back to a paper register with extra steps.
Offline mode also protects kiosk tablets at a factory gate during a broadband outage at 06:50 when 200 workers are queuing. The kiosk keeps accepting punches and syncs at 07:30; nobody is marked late for the company's connectivity problem. For multi-site businesses, see how multi-site businesses centralize attendance.
A guard rostered 20:00–08:00 at a basement parking post in Indore punches in at 19:57 with no signal. The app saves the punch with the phone time and the last GPS fix from the ramp, 30 metres from the geofence centre. At 08:05 he walks up to ground level; the app syncs the 19:57 in-punch and the 08:02 out-punch. The server sees both inside the shift window and geofence, marks a full 12-hour attendance with no late mark, and the client's man-hour report for that night is correct.
Attend Mitra's mobile apps and kiosk mode support offline attendance: punches are stored on the device with the captured time, GPS fix and selfie result and synced automatically when the network returns. Synced punches are shown on the live monitor with their original time and go through the same shift, grace and geofence rules as live punches.
