fix(worker): compile actor variables in sent notifications and exclude actor from fan-out fixes NV-8143#11753
Open
jainpawan21 wants to merge 1 commit into
Open
fix(worker): compile actor variables in sent notifications and exclude actor from fan-out fixes NV-8143#11753jainpawan21 wants to merge 1 commit into
jainpawan21 wants to merge 1 commit into
Conversation
…e actor from fan-out fixes NV-8143
Pass actor into the bridge execution event so v2 workflow step content
compiles actor variables (e.g. {{actor.firstName}}) in actual notifications,
not only in dashboard preview.
Also ensure the actor subscriber is never notified when triggering to an
array of subscribers, a topic, or a broadcast fan-out.
Co-authored-by: Pawan Jain <jainpawan21@users.noreply.github.com>
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
scopsy
reviewed
Jul 1, 2026
| }); | ||
|
|
||
| it('should only exclude actor from topic, should send event if actor explicitly included', async () => { | ||
| it('should exclude actor even when explicitly included in to recipients', async () => { |
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.
Summary
Completes the actor variable support started in NV-8143. Dashboard preview already compiled
{{actor.*}}variables, but actual notifications did not because the worker bridge execution path omittedactorfrom the framework event payload.This PR also tightens actor exclusion so the actor subscriber never receives a notification when triggering to multiple recipients (subscriber array, topic, or broadcast).
Root cause
V2 workflows compile step content via the framework bridge (
ExecuteBridgeJob). Preview passedactorinto the bridge event, but execution did not:sequenceDiagram participant API as Trigger API participant Worker as SendMessage participant Bridge as ExecuteBridgeJob participant FW as Framework compileControls API->>Worker: job with actorId Worker->>Worker: buildVariables (includes actor) Worker->>Bridge: variables with actor Note over Bridge: Previously dropped actor here Bridge->>FW: bridge event FW->>FW: render {{actor.firstName}}Changes
execute-bridge-job.usecase.ts: includeactorin the bridge event when present in compile context, matching preview behavior.trigger-multicast.usecase.ts: remove actor from directtosubscriber recipients before queueing jobs (topic fan-out already skipped actor).trigger-broadcast.usecase.ts: skip actor during broadcast fan-out.toinclusion.Verification
cd apps/worker && pnpm test -- --grep "ExecuteBridgeJob"— 4 passingcd apps/api && pnpm test -- --grep "TriggerMulticast"— 15 passingCustomer scenario
Trigger with:
{ "name": "events-update", "to": { "subscriberId": "recipient-id" }, "payload": { "eventName": "John Doe" }, "actor": "actor-subscriber-01" }In-app body
sent by {{actor.firstName}}should now render assent by <actor first name>in the delivered notification.Slack Thread
Greptile Summary
This PR completes actor support for sent notifications and prevents actors from receiving their own fan-out notifications. The main changes are:
actorvariables into the worker bridge event used for real notification execution.Confidence Score: 5/5
The changes are narrowly scoped to actor variable forwarding and actor exclusion in fan-out paths, with no remaining code issues identified.
The touched paths align with the described behavior and include targeted unit and end-to-end coverage for bridge actor passthrough and fan-out exclusion cases.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(worker): compile actor variables in ..." | Re-trigger Greptile