fix(visitor_mailer): debounce duplicate room booking change emails (PPT-2375) - #619
Merged
Conversation
The scheduler is terminated before on_unload runs, so any change still inside its debounce window was silently dropped on restart. Extract the settings-update drain into a shared helper and call it from on_unload with a 5s bound, staying inside the driver manager's 6s budget. Also document the pending change buffer key/value and the fields of PendingEventChange.
…PT-2375) Replace the timer per buffered event with a single periodic sweep. Each change records when its burst started and the sweep sends anything that has aged past the debounce, so buffering no longer has to schedule a flush outside the lock or track whether one is already pending. The buffer now survives a settings update — the fresh sweep picks the entries up, so an unrelated settings change no longer cuts the window short. Only disabling the debounce flushes, since no sweep would run. Also pass the buffered change around as an object rather than threading ten positional arguments through every call site.
Key the coalescing buffer on the ical uid, falling back to the event id. The signalled event id belongs to the metadata row, so it differs between the rooms either side of a move and between duplicate rows for one room — an edit that moved the meeting and changed its time sent an email per room. Grouping on the event instance collapses them into one. Merging across rooms means the room the email names has to be chosen: only a signal that reports the move advances it, so the old room's echo of the time change can't steal it back whichever order they arrive in.
chillfox
marked this pull request as ready for review
July 28, 2026 04:39
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.
No description provided.