You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
booking status updates do not guard stale writes #31
PATCH /bookings/{bookingId} updates booking status without a version check, ETag, or If-Match precondition. Two clients can read the same active booking and both send stale updates that succeed.
Evidence
apps/bot/services/booking-service/src/booking-router.ts:538 reads the current booking.
apps/bot/services/booking-service/src/booking-router.ts:542 validates the transition against that read copy.
apps/bot/services/booking-service/src/booking-router.ts:566 updates by id only, without checking the previously read status or a version field.
docs/openapi/metrix-bot-api.yaml currently does not enforce If-Match for booking updates on main.
Impact
Concurrent cancellations or reschedules can report success to more than one caller. The second caller is not told that it acted on stale state.
Expected Fix
Add optimistic concurrency control:
add a version field to booking.Booking;
return ETag with booking responses;
require/validate If-Match for status updates;
update with where: { id, version } or equivalent transactional guard;
Activity