Before any clock-in the server looks up the person's open shift; if there is one it responds ok with already:true. The same rule applies to a leader clocking someone else, and to clock-out with no open shift.
Also called: double clock in · duplicate shift · double tap on a laggy phone
- 1openShift() selects the most recent entry with clocked_in_at set and clocked_out_at null, limited to one by design.
- 2A partial index (idx_labor_open_shifts) makes that lookup cheap on every request.
- 3Clock-in with an existing shift returns the shift unchanged; clock-out with none returns already:true rather than an error.
Double-tapping a button on a laggy phone with cold hands is the norm rather than the exception, and two overlapping shifts for one man is a payroll problem nobody notices for a fortnight. A person can only ever have one shift open: the second tap is refused instead of recorded.
- Overlapping shifts inflating payroll silently.
- Errors shown to a worker for an action that already succeeded.
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →