fix(visitor_mailer): don't re-invite visitors when an event changes room (PPT-2375) - #620
Draft
chillfox wants to merge 1 commit into
Draft
fix(visitor_mailer): don't re-invite visitors when an event changes room (PPT-2375)#620chillfox wants to merge 1 commit into
chillfox wants to merge 1 commit into
Conversation
This was referenced Jul 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scenario 5 of PPT-2375: "Email notification to all visitors if the location changes — this is working, but the additional email trigger
visitor_invited.eventshould be stopped."Why it happens
Moving an event to another room makes the staff API re-announce every visitor already attending it on
staff/guest/attending, identically to a genuine new invitation. The driver turned each one into a full invitation email on top of the change notification, so visitors got both.The payloads are indistinguishable, so the driver correlates the two signals instead: an invite arriving as
meeting_updateis held for the debounce window and dropped if a change notification for the same event turns up. Matched onevent_ical_uidandevent_id, because either can be missing, and the staff API spawns both signals concurrently so neither order is guaranteed. A short memory of recently changed events covers an invite that arrives after the change email has already gone out, which is also what makes it work withevent_change_debounce: 0.Brand new invitations (
meeting_created) are never held.Also here
The change notification now carries
guest_jwt,kiosk_urland the same inlineqr.pngas an invitation — a move invalidates the kiosk link issued with the original invite (its token is scoped to the old room) and the invite is no longer re-sent. The templates need updating to reference them, ordisable_qr_code: trueto leave the attachment off.Trade-offs
Testing
14 new specs: both signal orders, several visitors, invites that must still be sent,
meeting_created,event_change_debounce: 0, suppression scoped per event, matching byevent_idalone, draining held invites, and the QR/kiosk fields on both changed templates../harness report --basic-render --verbose --tests=1 drivers/place/visitor_mailer_spec.crpasses;crystal tool formatandamebaclean.Paired with PlaceOS/staff-api#382, which stops the re-announcement at source. This PR does not depend on it.