Skip to content

fix(visitor_mailer): invite each visitor on a group booking once (PPT-2375) - #634

Merged
camreeves merged 2 commits into
masterfrom
PPT-2375-group-invitations
Sep 30, 2026
Merged

camreeves merged 2 commits into
masterfrom
PPT-2375-group-invitations

Conversation

@camreeves

Copy link
Copy Markdown
Contributor

What

A multi-visitor booking is a group container listing every visitor plus a child booking per visitor. staff-api emits a staff/guest/attending signal 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 group container that carries extension_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

  • Test 80 in the spec: a container signal sends nothing, the child signal sends one invitation, and a later container update for an added visitor sends nothing.
  • Type-check clean locally. Spec run on CI.
  • To verify on HIO UAT once the driver row is on this commit: Invite Visitor with two visitors, expect one invitation each; edit the booking to add a third visitor and move the time, expect the two existing visitors to get one change email each and the new visitor one invitation.

Related: PPT-2817 describes the creation-time half of this.

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
@camreeves

Copy link
Copy Markdown
Contributor Author

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.
@camreeves

Copy link
Copy Markdown
Contributor Author

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.

@camreeves
camreeves marked this pull request as ready for review September 28, 2026 05:08

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@camreeves camreeves self-assigned this Sep 29, 2026
@camreeves
camreeves merged commit 03d5a54 into master Sep 30, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant