completion.go ×9

Frontier kind: Code frontier

unlabeled · c_5ea42f90b4a5

2 tests · 191 LOC · 3 files · introduces 0 tests · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges19 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
90 ranges191 lines · 3 files · Browse complete extent
All tests (intent)
2 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.

Introduced files, introduced tests, and structurally relevant concept specializationcompletion.go ×1 · 3 introduced LOCcompletion.go ×1completion.go ×1 · 7 introduced LOCcompletion.go ×1completion.go ×5 · 10 introduced LOCcompletion.go ×5completion.go ×1 · 2 introduced LOCcompletion.go ×1completion.go ×2 · 4 introduced LOCcompletion.go ×2completion.go ×7 · 17 introduced LOCcompletion.go ×7api.go ×2 · 2 introduced LOCapi.go ×2valid, valid_custom_URL, +1 · 0 introduced LOCvalid, valid_custom_URL,…api.go ×2 · 2 introduced LOCapi.go ×2api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1completion.go ×2 · 6 introduced LOCcompletion.go ×2completion.go ×1 · 1 introduced LOCcompletion.go ×1api.go ×4 · 8 introduced LOCapi.go ×4completion.go ×15 · 30 introduced LOCcompletion.go ×15api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 3 introduced LOCapi.go ×1api.go ×2 · 5 introduced LOCapi.go ×2api.go ×2 · 7 introduced LOCapi.go ×2api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1timestamp.go ×4 · 9 introduced LOCtimestamp.go ×4api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1completion.go ×4 · 11 introduced LOCcompletion.go ×4api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×2 · 5 introduced LOCapi.go ×2api.go ×2 · 3 introduced LOCapi.go ×2api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 4 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1timestamp.go ×1 · 7 introduced LOCtimestamp.go ×1TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/common/nexus/nexusrpc/api.go · 295 LOCnexusrpc/api.gogo.temporal.io/server/common/nexus/nexusrpc/completion.go · 327 LOCnexusrpc/completion.gogo.temporal.io/server/common/nexus/nexusrpc/timestamp.go · 45 LOCnexusrpc/timestamp.goTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…multiple_links · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestAddLinksToHeader/multiple_linksmultiple_linkssingle_link · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestAddLinksToHeader/single_linksingle_linkvalid · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestDecodeLink/validvalidvalid_custom_URL · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestDecodeLink/valid_custom_URLvalid_custom_URLvalid_multiple_params · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestDecodeLink/valid_multiple_paramsvalid_multiple_paramsvalid_param_not_quoted · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestDecodeLink/valid_param_not_quotedvalid_param_not_quotedvalid · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestEncodeLink/validvalidvalid_custom_URL · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestEncodeLink/valid_custom_URLvalid_custom_URLTestFailureCompletion · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestFailureCompletionTestFailureCompletionTestFailureCompletion_CustomFailureConverter · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestFailureCompletion_CustomFailureConverterTestFailureCompletion_Cu…multiple_links · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestGetLinksFromHeader/multiple_linksmultiple_linksmultiple_links_single_header · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestGetLinksFromHeader/multiple_links_single_headermultiple_links_single_he…single_link · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestGetLinksFromHeader/single_linksingle_linkTestMarshalTimestampFormats · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestMarshalTimestampFormatsTestMarshalTimestampForm…Focused concept · completion.go ×9 · 19 introduced LOCcompletion.go ×9

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.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

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

1 file ranked by introduced lines: 19 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/nexus/nexusrpc/completion.go 19 introduced LOC · 9 ranges

Open complete file

118 // Set the body and operation state based on whether the completion is successful or not.
119 if c.Error != nil {
120 > failure, err := cc.failureConverter.ErrorToFailure(c.Error) completion.go
121 > if err != nil {
122 return err
123 }
124 // Backwards compatibility: if the failure has a cause, unwrap it to ensure behavior remains compatible with older servers.
125 > if failure.Cause != nil { completion.go
126 failure = *failure.Cause
127 }
128 > b, err := json.Marshal(failure) completion.go
129 > if err != nil {
130 return err
131 }
132 > request.Body = io.NopCloser(bytes.NewReader(b)) completion.go
133 > // Set the operation state header for backwards compatibility.
134 > request.Header.Set(headerOperationState, string(c.Error.State))
135 > request.Header.Set("Content-Type", contentTypeJSON)
136 } else {
137 reader, ok := c.Result.(*nexus.Reader)
255 }
256 switch completion.State {
257 > case nexus.OperationStateFailed, nexus.OperationStateCanceled: completion.go
258 > if !isMediaTypeJSON(request.Header.Get("Content-Type")) {
259 h.WriteFailure(writer, request, nexus.NewHandlerErrorf(nexus.HandlerErrorTypeBadRequest, "invalid request content type: %q", request.Header.Get("Content-Type")))
260 return
261 }
262 > var failure nexus.Failure completion.go
263 > b, err := io.ReadAll(request.Body)
264 > if err != nil {
265 h.WriteFailure(writer, request, nexus.NewHandlerErrorf(nexus.HandlerErrorTypeBadRequest, "failed to read Failure from request body"))
266 return
267 }
268 > if err := json.Unmarshal(b, &failure); err != nil { completion.go
269 h.WriteFailure(writer, request, nexus.NewHandlerErrorf(nexus.HandlerErrorTypeBadRequest, "failed to decode Failure from request body"))
270 return
271 }
272 > completionErr, err := h.FailureConverter.FailureToError(failure) completion.go
273 > if err != nil {
274 h.WriteFailure(writer, request, nexus.NewHandlerErrorf(nexus.HandlerErrorTypeBadRequest, "failed to decode Failure from request body"))
275 return
276 }
277 > opErr, ok := completionErr.(*nexus.OperationError) completion.go
278 > if !ok {
279 // Backwards compatibility: wrap non-OperationError errors in an OperationError with the appropriate state.
280 completion.Error = &nexus.OperationError{