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
The Firestore rules only check that a booking's first and last days are offered by the listing (#313), because rules can't loop over a range. A modified client can still book [d, d+2] when only d and d+2 are offered.
Idea: a Cloud Function on booking creation that checks every day in the range is in availableDates, and rejects or deletes the booking if not. The app itself only lets you pick offered days, so this only matters against modified clients.
Update from #360: bookings now store a days list, and the rules check every day with listing.availableDates.hasAll(data.days). So the gap described here (a day in the middle that is not offered) is closed once #360 merges.
What remains: rules can't loop over the list, so only the first day is checked against today. A modified client could still put a later past day in the list if the listing still offers it. The app sends days earliest first and never offers a past day. A Cloud Function would still be the way to check every day against today.
Activity
lucaschristiansson commentedon Nov 17, 2026
Update from #360: bookings now store a
dayslist, and the rules check every day withlisting.availableDates.hasAll(data.days). So the gap described here (a day in the middle that is not offered) is closed once #360 merges.What remains: rules can't loop over the list, so only the first day is checked against today. A modified client could still put a later past day in the list if the listing still offers it. The app sends days earliest first and never offers a past day. A Cloud Function would still be the way to check every day against today.
feat(booking): request separate days in one booking (#360)