From b61bf52df9ab485cd1caa9d0b0f0d36fdd8e191b Mon Sep 17 00:00:00 2001 From: William Petit Date: Fri, 3 Mar 2023 10:43:09 +0100 Subject: [PATCH] fix(module,net): add missing context to server message fix https://forge.cadoles.com/arcad/edge/issues/6 --- pkg/module/net/module.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/module/net/module.go b/pkg/module/net/module.go index 29eeb80..7047b8e 100644 --- a/pkg/module/net/module.go +++ b/pkg/module/net/module.go @@ -38,9 +38,10 @@ func (m *Module) broadcast(call goja.FunctionCall, rt *goja.Runtime) goja.Value } data := call.Argument(0).Export() + ctx := context.Background() - msg := module.NewServerMessage(nil, data) - if err := m.bus.Publish(context.Background(), msg); err != nil { + msg := module.NewServerMessage(ctx, data) + if err := m.bus.Publish(ctx, msg); err != nil { panic(rt.ToValue(errors.WithStack(err))) }