Production report: an online order was scheduled on top of an already scheduled order. Initial Slack context noted the two orders “were not the same day,” but follow-up on the inspections states the same inspector and inspection date were used and the inspector was already booked on the confirmed internal order when the online job was scheduled.
1008593660 was booked first, internally by a user.
Spectora changelog:

1008594585 was booked second, online.
Spectora Changelog:

Repro attempt (same brand instance): Ryan recreated the scenario with no success—tried multiple inspectors including the one from the incident. In both attempts the online scheduler did not show any slots for the time of the internally booked inspection. That indicates GET /schedule/optimal-slots overlap filtering behaves correctly when the internal inspection is already in Attik at slot-load time.
Code audit (likely incident class): Conflict prevention today is on the read path only (optimal-slots); POST /spectora/create-job and POST /inspection/book-job do not re-validate inspector availability at confirm. Plausible one-off causes for the original pair: Attik DB/sync lag after internal book, 5-minute cache(300) on optimal-slots, race between slot load and confirm, inspection/event queries that match start datetime only (not full interval overlap), or the two jobs not actually sharing the same datetime/endtime despite same calendar date.
Decision needed: Treat as investigation-first (prod timestamps on both inspections) vs. immediate hardening (book-time conflict check). Confirm whether datetime/endtime truly overlap before building a large scheduler change.
Slack: attik-talk thread
Backend
src/routes/schedule.ts (GET /optimal-slots, findAvailableSlots, TZDayjs interval overlap per inspector, cache(300)), src/util/functions/schedule/batchSlotOptimizingAlgo.ts, src/util/functions/slots/slotToHistory.ts, src/util/functions/calendar/inspectorIdMatching.ts.src/routes/spectora.ts → createSpectoraJob, src/routes/inspection.ts → POST /book-job.Inspection), Event (type Event and Block), vacations; cancelled inspections excluded.datetime, endtime, _inspectorId, status, scheduledLocation, createdAt on 1008593660 and 1008594585 vs. Spectora changelog timing.Frontend
src/app/scheduler/slots/SlotsStep.tsx (calls schedule/optimal-slots with excludeOverlapping), src/app/scheduler/summary/BookingJobLoader.tsx (posts spectora/create-job or inspection/book-job).src/util/functions/quote/manageWorkingHold.ts (Block events—not transactional with book).src/components/scheduling/NewSchedulingForm.tsx, DispatchSection.tsx also consume optimal-slots.src/routes/schedule.ts, src/routes/spectora.ts, src/routes/inspection.tssrc/app/scheduler/slots/SlotsStep.tsx, src/app/scheduler/summary/BookingJobLoader.tsxPlease authenticate to join the conversation.
Planned
Main App
10 days ago
Linear
Get notified by email when there are changes.
Planned
Main App
10 days ago
Linear
Get notified by email when there are changes.