Repository navigation
feat(notifications): email published schedule assignment changes - #210
Open
theosiemensrhodes wants to merge 9 commits into
Open
theosiemensrhodes wants to merge 9 commits into
theosiemensrhodes wants to merge 9 commits into
Conversation
theosiemensrhodes
force-pushed
the
feat/schedule-assignment-notifications
branch
from
November 23, 2026 05:58
d24506c to
96e00a4
Compare
theosiemensrhodes
force-pushed
the
feat/schedule-assignment-notifications
branch
3 times, most recently
from
November 23, 2026 20:40
906937f to
4f28f77
Compare
theosiemensrhodes
force-pushed
the
feat/schedule-assignment-notifications
branch
from
November 23, 2026 21:06
4f28f77 to
ab78d28
Compare
Signed-off-by: Theo Siemens-Rhodes <112789743+theosiemensrhodes@users.noreply.github.com>
Signed-off-by: Theo Siemens-Rhodes <112789743+theosiemensrhodes@users.noreply.github.com>
Signed-off-by: Theo Siemens-Rhodes <112789743+theosiemensrhodes@users.noreply.github.com>
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.
Volunteers currently receive no email when an admin adds or removes them from a published schedule. Enqueue a normal jobs.notify-schedule-assignment job through JobService in the same transaction as the assignment change.
Use pg-boss's native cancellation to replace older pending/active notices sharing a schedule/volunteer singleton key. Hidden edits cancel older jobs without creating retroactive notices. The handler rechecks publication, account status and membership and prepares the email under short-lived domain locks in term/course/schedule/user order. It releases the database transaction, rechecks cooperative native cancellation, and then sends through SMTP. A slow SMTP connection therefore does not retain domain locks or an application database connection. pg-boss owns persistence, retry backoff and completion.
Depends on #209 and is restacked on its cancellation/validation fixes. This diff contains the assignment job, template, ClassService integration and tests. No additional database state, migration, worker framework or delivery registry.
Scope coordination: #219 owns the concurrent publication/edit locking and schedule ownership fixes; #216 owns per-shift assignment history and effective roster behavior. Those changes require integration with this ClassService delta rather than duplicate implementations here.
Validation on the combined stack: TypeScript and production build pass. All 10 test files outside coverage-service.test.ts pass; the full run has 117 passing tests and 21 existing failures caused by past-dated July 2026 coverage fixtures, which are unchanged from main. Assignment coverage includes real pg-boss add/remove email delivery, enqueue rollback, stale/rapid changes, draft term/class gating, hidden-edit cancellation, inactive users, net-zero saves, writable domain rows during stalled SMTP, and cancellation checks after releasing database locks.
Delivery remains at-least-once. SMTP acceptance followed by a crash before job completion can duplicate a message. Changes committing after the final state/cancellation checks can race a message entering SMTP; later edits cannot retract an in-flight email.