Extending a Session After the Screen Has Locked By Yuan Zhou Canonical page: https://yuanzhou.dev/writing/booking-extension-state-machine Published: 2026-10-14 | Updated: 2026-10-14 Author: https://yuanzhou.dev/about Series: https://yuanzhou.dev/writing An extension changes a booking, a practice session, a device and scheduled cleanup. Fixing one endpoint was not enough until the staff-facing action used that same business transition. THE ENGINEERING DECISIONS - Do not apply a new-booking start-time guard to an already running session. - Use the confirmed device lock time for the recovery window. - Restore the business session and invalidate stale cleanup through one action. Figure: A direct device unlock changes the screen. A session extension must also update the booking, practice state and scheduled work. Image: https://yuanzhou.dev/articles/session-extension.svg THE FIRST FAILURE CAME FROM REUSING THE WRONG GUARD A venue allowed a reservation to begin when the customer actually arrived. An early start preserved the original duration but shifted the start and end to real seconds. The extension path then incorrectly reused the half-hour boundary rule intended for creating a new booking. The regression reproduced a 10:00 booking started at 09:37:24. Its original end was 10:07:24, and a 30-minute extension needed to produce 10:37:24. I removed the new-booking start guard from that cash extension path while retaining running-state, conflict, closing-time and maximum-duration checks. The repair did not redefine the venue’s ordinary reservation grid. A COMPLETED SESSION NEEDS AN EXPLICIT RECOVERY TRANSITION A later incident happened after the automatic end-of-session lock. Staff extended a customer, but the device stayed locked. Manually unlocking it did not stop the old delayed cleanup from exiting the practice session. The system had implemented ending and cleanup without the complete path back into an active session. The recovery window was anchored to the confirmed device lock time. A successful extension restored the same booking and practice session, issued the unlock, scheduled the new end and invalidated the old cleanup. The window was venue-specific, and manual locking or compensation did not restart it. THE SECOND REPORT EXPOSED THE ACTUAL STAFF PATH The next field report showed a direct device unlock, not a booking extension. The first service-level repair had therefore not been invoked. Although the interface described direct control as separate, it still offered an easy route that looked like the action staff needed. I replaced that ordinary unlock entry point with Resume plus time during the recovery window. It reused the booking extension operation. The server also rejected a direct unlock in that window, so an old tab could not bypass the corrected flow. The schedule and booking views refreshed at session expiry to expose the recovery state. Figure: Public booking interface context. The incident involved the lifecycle behind a reserved session, not the sample choices in this image. Image: https://yuanzhou.dev/golfjoy/booking-desktop.webp A STALE CLEANUP MUST NOT TOUCH THE NEXT CUSTOMER Cleanup and extension shared the device lease boundary. A late task needed to recognize that its authority had been superseded, instead of clearing the newly restored session or affecting the next booking. The new end time still had to satisfy conflicts, opening hours, duration and financial-state checks. The regressions covered automatic expiry, lock confirmation, recovery, the correct device-to-booking mapping, re-enabling and stale-cleanup invalidation. Production publication and read-only health checks were recorded for the repair. The record still requested a full field replay through the new Resume action, so backend health is not presented as proof of that physical replay. REPAIR THE BUSINESS ACTION ALL THE WAY TO THE BUTTON The incident changed how I reviewed an operational fix. The service could be correct while the person continued to choose a different control. A complete repair aligned the visible action, server guard, domain transition and delayed work. That is a stronger unit of delivery than a successful unlock response. PROJECT CONTEXT AND EVIDENCE Written from my August 2026 venue extension incident, repair and release records. Internal records are summarized; no private customer data, credentials or employer source code is reproduced. GolfJoy Play: https://play.golfjoy.com/ Public platform context. Acceptance and release scope are stated in the article. GolfJoy engineering case study: https://yuanzhou.dev/work/golfjoy Public product interfaces and attribution for the delivered projects. RELATED ARTICLES Pricing a Booking Across Rate Boundaries: https://yuanzhou.dev/writing/booking-across-price-boundaries Device Control When the Result Is Uncertain: https://yuanzhou.dev/writing/device-authorizations-and-uncertain-results Moving an Eight-Bay Venue to Production: https://yuanzhou.dev/writing/eight-bay-venue-rollout