Test Run banner says Notify sends real email, but Notify is faked in the sandbox #151

Closed
opened 2026-11-28 06:41:10 -05:00 by dohertj2 · 1 comment
Owner

Summary

The Test Run panel in the template script dialog and the shared-script form says External, Database and Notify "fire for real … real HTTP, real SQL, real emails". For Notify that is false: Test Run gives scripts SandboxNotifyTarget, whose Send returns a random GUID and enqueues and delivers nothing (src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/SandboxHostHelpers.cs:150-168).

Impact

An operator tests a notification script, gets WasSuccessful: true and a NotificationId, and waits for an email that never arrives. No row appears in Notifications / the Notification Report either.

Repro (DEV vd03, 2026-11-28)

Template NotifyExample (49) → script SendTestNotification → Test Run with NotificationList = <a list containing your own address>. The run returns NotificationId 5f200e728cb04db1a0e7a930cb2ca9de. SELECT … FROM Notifications WHERE NotificationId = '5f200e72…' returns 0 rows, and no email arrives. The same script on a deployed instance (Flow Debugger) is Delivered in ~4 s.

Banner text locations

  • src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/TemplateScriptDialog.razor:167
  • src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/SharedScriptForm.razor:113

Fix (pick one)

  • Correct the banner: Notify is simulated (a fake id is returned and nothing is sent); point users at Flow Debugger on a deployed instance for a real send. Optionally write a console line from the sandbox Send ("[sandbox] Notify.To('X').Send not delivered").
  • Or make it real: route the sandbox Send into the central Notification Outbox (insert-if-not-exists, the same as site ingest), so it really sends, matching the banner and the External/Database behaviour.
## Summary The Test Run panel in the template script dialog and the shared-script form says `External`, `Database` and `Notify` "fire for real … real HTTP, real SQL, real emails". For `Notify` that is false: Test Run gives scripts `SandboxNotifyTarget`, whose `Send` returns a random GUID and enqueues and delivers nothing (`src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/SandboxHostHelpers.cs:150-168`). ## Impact An operator tests a notification script, gets `WasSuccessful: true` and a NotificationId, and waits for an email that never arrives. No row appears in `Notifications` / the Notification Report either. ## Repro (DEV vd03, 2026-11-28) Template `NotifyExample` (49) → script `SendTestNotification` → Test Run with `NotificationList = <a list containing your own address>`. The run returns `NotificationId 5f200e728cb04db1a0e7a930cb2ca9de`. `SELECT … FROM Notifications WHERE NotificationId = '5f200e72…'` returns 0 rows, and no email arrives. The same script on a deployed instance (Flow Debugger) is Delivered in ~4 s. ## Banner text locations - `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/TemplateScriptDialog.razor:167` - `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/SharedScriptForm.razor:113` ## Fix (pick one) - **Correct the banner:** `Notify` is simulated (a fake id is returned and nothing is sent); point users at Flow Debugger on a deployed instance for a real send. Optionally write a console line from the sandbox `Send` ("[sandbox] Notify.To('X').Send not delivered"). - **Or make it real:** route the sandbox `Send` into the central Notification Outbox (insert-if-not-exists, the same as site ingest), so it really sends, matching the banner and the External/Database behaviour.
dohertj2 added the type:bugpriority:p3 labels 2026-11-28 06:41:10 -05:00
Author
Owner

Fixed in 8010fee2 (main): chose 'correct the banner'. Both Test Run banners now say External/Database are real and Notify is simulated (fake NotificationId, nothing queued or sent) and point to Deployment → Flow Debugger for a real send. The sandbox Notify.To(list).Send also writes a '[sandbox] ... not delivered' line to the Test Run console.

Fixed in 8010fee2 (main): chose 'correct the banner'. Both Test Run banners now say External/Database are real and Notify is simulated (fake NotificationId, nothing queued or sent) and point to Deployment → Flow Debugger for a real send. The sandbox Notify.To(list).Send also writes a '[sandbox] ... not delivered' line to the Test Run console.
Sign in to join this conversation.