Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/wshrpc/wshclient/wshclientutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func sendRpcRequestResponseStreamHelper[T any](w *wshutil.WshRpc, command string
rtnErr(respChan, err)
return respChan
}
opts.StreamCancelFn = func(ctx context.Context) error {
return reqHandler.SendCancel(ctx)
opts.StreamCancelFn = func() {
reqHandler.SendCancel(context.Background())
Comment on lines +66 to +67

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stream cancel callback still mismatches web handler signature

The new zero-arg StreamCancelFn here still does not match how it is consumed: handleRemoteStreamFileFromCh in pkg/web/web.go expects a func(context.Context) error and passes that type through rpcOpts.StreamCancelFn, so after this change the web package will still fail to compile with a type error (func() vs func(context.Context) error). This patch therefore doesn’t resolve the build break that motivated it; building the web server will still halt at that call site.

Useful? React with 👍 / 👎.

}
go func() {
defer func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/wshrpc/wshrpctypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down