Repository navigation
fix(booking): PROJ-1652 hydrate_parents with no parent ids - #335
Merged
Merged
Conversation
Booking.hydrate_parents queried `id IN ()` when none of the bookings had a parent_id, which Postgres rejects as a syntax error. staff-api calls it for every non-empty result when include_parent_bookings=true, so Concierge's asset request list (type=asset-request, parentless bookings) answered 500. Return the bookings unchanged when there are no parent ids to load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
camreeves
added a commit
to PlaceOS/staff-api
that referenced
this pull request
Oct 16, 2026
9.119.6 is 9.119.5 plus PlaceOS/models#335: Booking.hydrate_parents no longer runs `id IN ()` when no booking in the page has a parent, which made Concierge asset requests return a 500. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
Booking.hydrate_parentsalways ranBooking.where(id: parent_ids). When none of the bookings has aparent_idthat list is empty, pg-orm rendersid IN (), and Postgres answerssyntax error at or near ")".staff-api calls it for any non-empty result when
include_parent_bookings=true. Concierge's Assets page sends that withtype=asset-request, and asset requests linked to a meeting have no parent booking, so the list answers 500 (PROJ-1652, seen on Nestle).Reproduced on placeos-dev on 16 Oct: the same bookings query returns 200 without
include_parent_bookingsand 500 with it.Change
Return the bookings unchanged when there are no parent ids to load.
Tests
New spec
hydrate_parents returns bookings that have no parent unchanged. Run withspec/tenant_spec.cr spec/booking_spec.cron a fresh database:syntax error at or near ")" (PQ::PQError)booking_spec.cron its own errors on everyGenerator.tenantcall, because the tenants table is only cleared by another file's globalbefore_each. That is unrelated to this change.After merge
staff-api needs a models release and a shard bump to pick this up.
🤖 Generated with Claude Code