fix(server): unbreak workflow engine init - import fetchT, new NotificationManager, hoist servicesStateManager
CI / Test & Lint (push) Has been cancelled
CI / Security audit (push) Has been cancelled

Three cascading bugs in server.js's workflow engine init block:

1. fetchT was referenced but never imported from ./src/utils/http
2. notification-manager was called as factory function but the module
   now exports a class (NotificationManager) - need 'new'
3. servicesStateManager was referenced in workflowCtx but only created
   later inside an async IIFE (out of scope at workflow init time)

Result: every container start logged
  Workflow engine failed to initialize - fetchT is not defined
and the workflow engine never actually wired to resourceMonitor/
updateManager event sources. The 'app' context workflow engine
still ran but didn't get those connections.

Fix:
- Import fetchT at top of file
- Use 'new' for NotificationManager instantiation
- Hoist servicesStateManager creation before workflow init and
  remove the duplicate inside the health-checker async IIFE

Verified: container restart shows
  [server] Workflow engine initialized
  [ResourceMonitor] Workflow engine configured
  [UpdateManager] Workflow engine configured
in the log, no more errors at startup.

Also bumps VERSION to current SHA (bump from c64bbe2).
This commit is contained in:
Krystie
2026-06-18 20:15:23 -07:00
parent ef855e3fd7
commit 4853f1feb8
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
c64bbe2
db14233