fix(visitor_mailer): invite each visitor on a group booking once (PPT-2375) - #634
Conversation
A multi-visitor booking is a group container listing every visitor plus a child booking per visitor, and staff-api signals a guest event for both, so each visitor received two identical invitations when the booking was created and again when they were added to an existing booking. The container's guest events are now ignored when it carries the group member list: the visitor's own child booking sends the invitation, and its id is the one the QR code and check-in use. The host and booker notifications follow the same rule, so they also go once per visitor. PPT-2375
|
Verified on HIO UAT with this commit on both visitor mailer modules (28 Sep, 13:50 to 13:55 AEST, host FNU LNU, Ord Street). Two visitors invited together: one invitation each. Editing the booking to add a third visitor and move the start by 30 minutes: the two existing visitors got one "details changed" email each, the new visitor got one invitation, nothing else. Request bodies captured in the browser show the container PATCH with all three attendees, a PATCH per existing child and a POST for the new child, as the fix assumes. CI: both subset spec jobs hit the spec runner's 6 minute limit at 03:50:50 after starting at 03:44:50. The previous two runs of this spec on PRs #631 and #632 took 5:21 and 5:32, so the spec was already within 30 seconds of the limit before this test was added. |
The spec runner stops a driver's spec after six minutes, and this spec took 5:21 and 5:32 on its last two CI runs before test 80 pushed both subset jobs into a timeout. About 280 seconds of the run was sleeping: the 1.5 second waits after a published signal, which the driver handles in milliseconds, now match the 1 second used elsewhere, and the 8 second waits for a 2 second debounce plus a 2 second sweep now wait 6.
|
Both subset spec jobs pass at b7f14c1 after trimming the spec's waits (the 1.5 second waits after a signal now match the 1 second used elsewhere, the 8 second debounce waits are 6). Style fails as it does on master. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
What
A multi-visitor booking is a group container listing every visitor plus a child booking per visitor. staff-api emits a
staff/guest/attendingsignal for each of them, so every visitor got two identical invitations at creation, and a visitor added to an existing group got two more (one from the container PATCH, one from their new child POST). Found by QA on HIO UAT (PPT-2375, 28 Sep) and reproduced there with request bodies captured: the container PATCH carries the full attendee list, then each existing child is patched and the new child posted.The driver now ignores guest events on a
groupcontainer that carriesextension_data.group_members. The visitor's own child booking sends the invitation, and its id is the one the QR code and check-in use. The host and booker notifications from PPT-2692 hang off the same path, so they also go once per visitor instead of twice.Testing
Related: PPT-2817 describes the creation-time half of this.