workflow_handler.go ×8

Frontier kind: Joint frontier

unlabeled · c_83dd3692001f

3 tests · 3895 LOC · 199 files · introduces 2 tests · 44 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges44 lines · 2 files
Tests
2 tests

Contains — complete concept membership

All code (extent)
580 ranges3895 lines · 199 files · Browse complete extent
All tests (intent)
3 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

2 tests introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 44 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/frontend/workflow_handler.go 31 introduced LOC · 8 ranges

Open complete file

6317 }
6318
6319 > func (wh *WorkflowHandler) RespondNexusTaskCompleted(ctx context.Context, request *workflowservice.RespondNexusTaskCompletedRequest) (_ *workflowservice.RespondNexusTaskCompletedResponse, retError error) { workflow_handler.go
6320 > defer log.CapturePanic(wh.logger, &retError)
6321 >
6322 > if request == nil {
6323 return nil, errRequestNotSet
6324 }
6325
6326 > if r := request.GetResponse().GetStartOperation().GetAsyncSuccess(); r != nil { workflow_handler.go
6327 operationToken := r.OperationToken
6328 if operationToken == "" && r.OperationId != "" { //nolint:staticcheck // SA1019 this field might be by old clients.
6343 // There's no need to validate that the namespace in the token and the request match,
6344 // NamespaceValidatorInterceptor does this for us.
6345 > tt, err := wh.tokenSerializer.DeserializeNexusTaskToken(request.GetTaskToken()) workflow_handler.go
6346 > if err != nil {
6347 return nil, errDeserializingToken
6348 }
6349 > if tt.GetTaskQueue() == "" || tt.GetTaskId() == "" { workflow_handler.go
6350 return nil, errInvalidTaskToken
6351 }
6352 > namespaceId := namespace.ID(tt.GetNamespaceId()) workflow_handler.go
6353 >
6354 > // NOTE: Not checking blob size limit here as we already enforce the 4 MB gRPC request limit and since this
6355 > // doesn't go into workflow history, and the Nexus request caller is unknown, there doesn't seem like there's a
6356 > // good reason to fail at this point.
6357 >
6358 > // nolint:staticcheck // checking deprecated field for backwards compatibility
6359 > if opErr := request.GetResponse().GetStartOperation().GetOperationError(); opErr != nil {
6360 if details := opErr.GetFailure().GetDetails(); details != nil && !json.Valid(details) {
6361 return nil, serviceerror.NewInvalidArgument("failure details must be JSON serializable")
6363 }
6364
6365 > taskQueueKind := tt.GetTaskQueueKind() workflow_handler.go
6366 > if taskQueueKind == enumspb.TASK_QUEUE_KIND_UNSPECIFIED {
6367 taskQueueKind = enumspb.TASK_QUEUE_KIND_NORMAL
6368 }
6369 > matchingRequest := &matchingservice.RespondNexusTaskCompletedRequest{ workflow_handler.go
6370 > NamespaceId: namespaceId.String(),
6371 > TaskQueue: &taskqueuepb.TaskQueue{
6372 > Name: tt.GetTaskQueue(),
6373 > Kind: taskQueueKind,
6374 > },
6375 > TaskId: tt.GetTaskId(),
6376 > Request: request,
6377 > }
6378 >
6379 > _, err = wh.matchingClient.RespondNexusTaskCompleted(ctx, matchingRequest)
6380 > if err != nil {
6381 return nil, err
6382 }
6383 > return &workflowservice.RespondNexusTaskCompletedResponse{}, nil workflow_handler.go
6384 }
6385
go.temporal.io/server/api/matchingservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

684
685 // RespondNexusTaskCompleted mocks base method.
686 > func (m *MockMatchingServiceClient) RespondNexusTaskCompleted(ctx context.Context, in *matchingservice.RespondNexusTaskCompletedRequest, opts ...grpc.CallOption) (*matchingservice.RespondNexusTaskCompletedResponse, error) { service_grpc.pb.mock.go
687 > m.ctrl.T.Helper()
688 > varargs := []any{ctx, in}
689 > for _, a := range opts {
690 varargs = append(varargs, a)
691 }
692 > ret := m.ctrl.Call(m, "RespondNexusTaskCompleted", varargs...) service_grpc.pb.mock.go
693 > ret0, _ := ret[0].(*matchingservice.RespondNexusTaskCompletedResponse)
694 > ret1, _ := ret[1].(error)
695 > return ret0, ret1
696 }
697
698 // RespondNexusTaskCompleted indicates an expected call of RespondNexusTaskCompleted.
699 > func (mr *MockMatchingServiceClientMockRecorder) RespondNexusTaskCompleted(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
700 > mr.mock.ctrl.T.Helper()
701 > varargs := append([]any{ctx, in}, opts...)
702 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RespondNexusTaskCompleted", reflect.TypeOf((*MockMatchingServiceClient)(nil).RespondNexusTaskCompleted), varargs...)
703 > }
704
705 // RespondNexusTaskFailed mocks base method.