get_history_util.go ×4

Frontier kind: Code frontier

unlabeled · c_4fcac8305bd9

12 tests · 3027 LOC · 156 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
455 ranges3027 lines · 156 files · Browse complete extent
All tests (intent)
12 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.

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: 23 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/get_history_util.go 23 introduced LOC · 4 ranges

Open complete file

558 isCloseEventOnly bool,
559 history *historypb.History,
560 > ) error { get_history_util.go
561 > // Backwards-compatibility fix for retry events after #1866: older SDKs don't know how to "follow"
562 > // subsequent runs linked in WorkflowExecutionFailed or TimedOut events, so they'll get the wrong result
563 > // when trying to "get" the result of a workflow run. (This applies to cron runs also but "get" on a cron
564 > // workflow isn't really sensible.)
565 > //
566 > // To handle this in a backwards-compatible way, we'll pretend the completion event is actually
567 > // ContinuedAsNew, if it's Failed or TimedOut. We want to do this only when the client is looking for a
568 > // completion event, and not when it's getting the history to display for other purposes. The best signal
569 > // for that purpose is `isCloseEventOnly`. (We can't use `isLongPoll` also because in some cases, older
570 > // versions of the Java SDK don't set that flag.)
571 > //
572 > // TODO: We can remove this once we no longer support SDK versions prior to around September 2021.
573 > // Revisit this once we have an SDK deprecation policy.
574 > followsNextRunId := versionChecker.ClientSupportsFeature(ctx, headers.FeatureFollowsNextRunID)
575 > if isCloseEventOnly && !followsNextRunId && len(history.Events) > 0 {
576 > lastEvent := history.Events[len(history.Events)-1]
577 > fakeEvent, err := makeFakeContinuedAsNewEvent(ctx, lastEvent)
578 > if err != nil {
579 return err
580 }
581 > if fakeEvent != nil { get_history_util.go
582 history.Events[len(history.Events)-1] = fakeEvent
583 }
584 }
585 > return nil get_history_util.go
586 }
587
589 _ context.Context,
590 lastEvent *historypb.HistoryEvent,
591 > ) (*historypb.HistoryEvent, error) { get_history_util.go
592 > switch lastEvent.EventType { // nolint:exhaustive
593 case enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED:
594 if lastEvent.GetWorkflowExecutionCompletedEventAttributes().GetNewExecutionRunId() == "" {