-
Notifications
You must be signed in to change notification settings - Fork 1
seatConfirmationSent field not written when API request times out #79
Description
When the API request to send a seat confirmation email fails while awaiting confirmation on the /ticket/select page, the seatConfirmationSent field on the ticket's Firestore document should be set to false.
However, when the API request times out (which could potentially happen when the number of seats in the ticket is >40), this seatConfirmationSent field does not get set, and it stays non-existent.
Most of our scripts implicitly assume that fields that we check always exist. One of the reasons for this design is that Firestore automatically filters out documents that does not contain a specific field in most (if not all) "where" queries or other queries alike.
Therefore, we need to make sure seatConfirmationSent should always exist when seatConfirmed is set to true. In this case, we need to set seatConfirmed = true and seatConfirmationSent = false simultaneously (e.g. using a transaction).