From df6a1209c772fd5b5d511ed00483d059994fcf7a Mon Sep 17 00:00:00 2001 From: PratikDhanave Date: Tue, 22 Sep 2026 08:43:54 +0530 Subject: [PATCH] Fix OnMessageDeliveryStarting godoc: hooks stop on first error Composed OnMessageDeliveryStarting hooks are chained by extendContextHook, which returns immediately when the first hook errors without running the second. The doc said it "invokes all" hooks; unlike OnMessageDeliveryFinished (extendFinishedHook), it does not. Clarify the short-circuit behavior. --- workflow/executor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/executor.go b/workflow/executor.go index cbed9b6f..76c0e458 100644 --- a/workflow/executor.go +++ b/workflow/executor.go @@ -306,8 +306,8 @@ func (e *Executor) OnCheckpointRestored(ctx *Context) error { return nil } -// OnMessageDeliveryStarting invokes all configured OnMessageDeliveryStarting -// hooks. Returns the first error from any hook. +// OnMessageDeliveryStarting invokes the configured OnMessageDeliveryStarting +// hooks in order, stopping at and returning the first hook error. func (e *Executor) OnMessageDeliveryStarting(ctx *Context) error { if e.OnMessageDeliveryStartingFunc != nil { return e.OnMessageDeliveryStartingFunc(ctx)