Repository navigation
GET /v1/bookings: add updated_since (including cancellations) for efficient sync #262
Replies: 1 comment
|
Yes, this is a real hole and the shape is right. Polling Accepted as proposed: Four details worth getting right first time.
Also worth saying in the docs: this is a catch-up mechanism, not a replacement for webhooks. Its value is precisely that it closes the gap after a missed delivery, so the two should be described together. PR welcome. Update the API docs in the same change, and the CLA bot will ask you for a one-line phrase on the PR if you have not signed yet. |
Uh oh!
There was an error while loading. Please reload this page.
We sync bookings to an external service (an SMS reminder sender) by polling GET /v1/bookings. Today the list filters by from/to on start_at, status, when, event_type etc., and excludes cancelled bookings unless status=cancelled is set explicitly. So a poller has to:
fetch the whole upcoming window on every run,
detect cancellations by a booking disappearing from the list (or make a second call with status=cancelled),
detect reschedules by diffing start_at.
Proposal: an updated_since= parameter returning every booking whose row changed after that instant, including cancelled ones, ordered by updated_at ascending, with updated_at in each item. A client keeps a cursor (the last updated_at it saw) and gets an exact change feed, which is also useful as a fallback when a webhook delivery was missed. The bookings table already has updated_at. The change would make sure every status, time and host change bumps it, and possibly add an index on it.
Happy to implement (handler + booking.ListFilter + tests + docs) if this fits your API design.
All reactions