Commit

8509dfd

Lesson learned building mybirth.day: a guest limit counts chairs, not maybes. When a host turns on "Limit the guest list", only people who said Going take a seat. Holding one for somebody who said Maybe is how a party ends up turning away people who said yes. If "Guests can bring someone" is on, each +1 takes a chair too. The last chair is a real race: two people tap Going in the same second, both read the same count, both fit. Locking the guest rows being counted doesn't work, because Postgres won't do FOR UPDATE alongside an aggregate. So every RSVP locks the event row instead. That serializes them just as well, and it also covers someone answering straight from the link who has no guest row yet. Whoever loses the race sees "This event is full." mybirth.day/get

commit 8509dfd