You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: extend batching to all WorkflowNotification event types (v0.38.0)
Previously notification_cadence only batched submission_received and
approval_request. The other three conclusion events always fired
immediately. Now all four WorkflowNotification event types respect
the cadence setting.
workflow_engine.py:
- Add _notify_workflow_notification_with_cadence() shared helper that
checks cadence, queues via _queue_workflow_level_notifications when
non-immediate, and falls back to immediate on error
- _notify_submission_created: stage form-field notifications always
fire immediately; WorkflowNotification path goes through new helper
- _notify_final_approval, _notify_rejection: same pattern via helper
views.py:
- Withdrawal routes through _notify_workflow_notification_with_cadence
tasks.py:
- Replace _queue_submission_notifications with generalized
_queue_workflow_level_notifications(submission, workflow, type)
resolving WorkflowNotification rules with full condition and
recipient evaluation
- Add _dispatch_conclusion_digest for approval/rejection/withdrawal
- send_batched_notifications handles all five notification types
models.py:
- PendingNotification.NOTIFICATION_TYPES expanded
337 tests pass. Bump 0.37.17 to 0.38.0
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
## [0.38.0] - 2026-03-27
11
+
12
+
### Added
13
+
-**Batching for all WorkflowNotification event types** — `notification_cadence` now applies to every workflow-conclusion event (`approval_notification`, `rejection_notification`, `withdrawal_notification`) in addition to the existing `submission_received`. Previously only `submission_received` and `approval_request` were batched; the other three always fired immediately regardless of cadence.
14
+
-**`_queue_workflow_level_notifications(submission, workflow, notification_type)`** — replaces the old `_queue_submission_notifications` helper. Resolves every matching `WorkflowNotification` rule (evaluating conditions and all three recipient sources — `notify_submitter`, `email_field`, `static_emails`) and creates one `PendingNotification` row per resolved recipient, correctly honouring per-rule conditions and the full recipient resolution logic.
15
+
-**`_dispatch_conclusion_digest`** — new batch-dispatch function for `approval_notification`, `rejection_notification`, and `withdrawal_notification` digests, reusing the existing `notification_digest.html` template with a verb/label context (`approved`/`rejected`/`withdrawn`).
16
+
-**`_notify_workflow_notification_with_cadence(submission, notification_type)`** — shared helper in `workflow_engine.py` that checks `notification_cadence` and either queues via `_queue_workflow_level_notifications` or fires `send_workflow_definition_notifications` immediately. Used by `_notify_submission_created`, `_notify_final_approval`, `_notify_rejection`, and the withdrawal view.
17
+
18
+
### Changed
19
+
-`PendingNotification.NOTIFICATION_TYPES` expanded with `approval_notification`, `rejection_notification`, `withdrawal_notification`.
20
+
-`send_batched_notifications` dispatch block handles all five notification types; unknown types are logged and skipped rather than silently dropped.
21
+
- Stage `StageFormFieldNotification` events always fire immediately regardless of cadence — this is unchanged and intentional.
0 commit comments