Skip to content

fix(visitor_mailer): debounce duplicate room booking change emails (PPT-2375) - #619

Merged
stakach merged 8 commits into
masterfrom
PPT-2375_12
Jul 28, 2026
Merged

fix(visitor_mailer): debounce duplicate room booking change emails (PPT-2375)#619
stakach merged 8 commits into
masterfrom
PPT-2375_12

Conversation

@chillfox

Copy link
Copy Markdown
Contributor

No description provided.

@chillfox chillfox self-assigned this Jul 23, 2026
@chillfox chillfox changed the title fix(visitor_mailer): debounce duplicate room booking change emails (P… fix(visitor_mailer): debounce duplicate room booking change emails (PPT-2375) Jul 23, 2026
chillfox added 7 commits July 23, 2026 15:33
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
chillfox marked this pull request as ready for review July 28, 2026 04:39
@chillfox
chillfox requested review from naqvis and stakach July 28, 2026 04:39
@stakach
stakach merged commit e17bc11 into master Jul 28, 2026
2 of 6 checks passed
@stakach
stakach deleted the PPT-2375_12 branch July 28, 2026 04:44
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.

2 participants