Skip to content

Commit ba831c3

Browse files
authored
Fix marshaling of payloads with null values (#617)
Fixes #607 Bump `api` to pull in temporalio/api-go#159
1 parent f51e0d5 commit ba831c3

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ require (
154154
modernc.org/token v1.1.0 // indirect
155155
)
156156

157-
replace go.temporal.io/api v1.34.0 => go.temporal.io/api v1.32.1
157+
// See https://github.com/temporalio/cli/pull/596#discussion_r1666988960
158+
// #596 downgraded api to 1.32.1, but there are required bug fixes that came after 1.32.1.
159+
replace go.temporal.io/api v1.34.0 => go.temporal.io/api v1.32.1-cherry-pick-for-cli-tag
158160

159161
replace github.com/nexus-rpc/sdk-go v0.0.8-0.20240502185337-2b47041a2cc2 => github.com/nexus-rpc/sdk-go v0.0.7

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2L
349349
go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
350350
go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
351351
go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
352-
go.temporal.io/api v1.32.1 h1:jivpWVuxUya9XkmJTcLLcb2kFqkwrknXpx13HlaQR0Y=
353-
go.temporal.io/api v1.32.1/go.mod h1:DATVgu+KiAYVjFvOSXB9AVoYZT1yjGt6IPbb7bDw8Qs=
352+
go.temporal.io/api v1.32.1-cherry-pick-for-cli-tag h1:4dQtGBBa+VTubnrKgCBB7QwTb0l4omuB/J/C263i7HU=
353+
go.temporal.io/api v1.32.1-cherry-pick-for-cli-tag/go.mod h1:DATVgu+KiAYVjFvOSXB9AVoYZT1yjGt6IPbb7bDw8Qs=
354354
go.temporal.io/sdk v1.27.0 h1:C5oOE/IRyLcZaFoB13kEHsjvSHEnGcwT6bNys0HFFHk=
355355
go.temporal.io/sdk v1.27.0/go.mod h1:PnOq5f3dWuU2NAbY+yczXkIeycsIIdBtoCO62ZE0aak=
356356
go.temporal.io/server v1.24.1 h1:PfLwLNZKFPUFYXDpHvi7fqQC94VAHI3Ssn7bSqYzzCU=

temporalcli/commands.workflow_exec_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,3 +646,21 @@ func jsonPath(v any, path ...string) any {
646646
}
647647
return jsonPath(v, path[1:]...)
648648
}
649+
650+
func (s *SharedServerSuite) TestWorkflow_Execute_NullValue() {
651+
// Regression test: see https://github.com/temporalio/cli/pull/617
652+
s.Worker().OnDevWorkflow(func(ctx workflow.Context, input any) (any, error) {
653+
return map[string]any{"foo": nil}, nil
654+
})
655+
res := s.Execute(
656+
"workflow", "execute",
657+
"--address", s.Address(),
658+
"--task-queue", s.Worker().Options.TaskQueue,
659+
"--type", "DevWorkflow",
660+
"--workflow-id", "my-id",
661+
)
662+
s.NoError(res.Err)
663+
out := res.Stdout.String()
664+
s.ContainsOnSameLine(out, "Status", "COMPLETED")
665+
s.ContainsOnSameLine(out, "Result", `{"foo":null}`)
666+
}

0 commit comments

Comments
 (0)