From 10f740df948444e8b92ea1aa8cf5498d78385729 Mon Sep 17 00:00:00 2001 From: Steven Vo <875426+stevenvo@users.noreply.github.com> Date: Fri, 26 Dec 2025 00:00:05 +0700 Subject: [PATCH] Fix StreamCancelFn type definition StreamCancelFn was incorrectly defined as func() but is actually used as func(context.Context) error throughout the codebase. Evidence of actual usage: - web.go:276: streamCancelFn(ctx) - called with context - wshclientutil.go:67: return reqHandler.SendCancel(ctx) - returns error This caused build failures: - wshclientutil.go:66: cannot use func(ctx context.Context) error as func() value - web.go:255: cannot use func() as func(context.Context) error value Fix: Correct the type definition in wshrpctypes.go:376 Fixes #2709 --- pkg/wshrpc/wshrpctypes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/wshrpc/wshrpctypes.go b/pkg/wshrpc/wshrpctypes.go index 14ffb1477..fe8956dfa 100644 --- a/pkg/wshrpc/wshrpctypes.go +++ b/pkg/wshrpc/wshrpctypes.go @@ -373,7 +373,7 @@ type RpcOpts struct { NoResponse bool `json:"noresponse,omitempty"` Route string `json:"route,omitempty"` - StreamCancelFn func() `json:"-"` // this is an *output* parameter, set by the handler + StreamCancelFn func(context.Context) error `json:"-"` // this is an *output* parameter, set by the handler } const (