Skip to content

Commit

Permalink
Fix marshaling of payloads with null values (#617)
Browse files Browse the repository at this point in the history
Fixes #607

Bump `api` to pull in temporalio/api-go#159
  • Loading branch information
dandavison authored Jul 5, 2024
1 parent f51e0d5 commit ba831c3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ require (
modernc.org/token v1.1.0 // indirect
)

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

replace github.com/nexus-rpc/sdk-go v0.0.8-0.20240502185337-2b47041a2cc2 => github.com/nexus-rpc/sdk-go v0.0.7
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2L
go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
go.temporal.io/api v1.32.1 h1:jivpWVuxUya9XkmJTcLLcb2kFqkwrknXpx13HlaQR0Y=
go.temporal.io/api v1.32.1/go.mod h1:DATVgu+KiAYVjFvOSXB9AVoYZT1yjGt6IPbb7bDw8Qs=
go.temporal.io/api v1.32.1-cherry-pick-for-cli-tag h1:4dQtGBBa+VTubnrKgCBB7QwTb0l4omuB/J/C263i7HU=
go.temporal.io/api v1.32.1-cherry-pick-for-cli-tag/go.mod h1:DATVgu+KiAYVjFvOSXB9AVoYZT1yjGt6IPbb7bDw8Qs=
go.temporal.io/sdk v1.27.0 h1:C5oOE/IRyLcZaFoB13kEHsjvSHEnGcwT6bNys0HFFHk=
go.temporal.io/sdk v1.27.0/go.mod h1:PnOq5f3dWuU2NAbY+yczXkIeycsIIdBtoCO62ZE0aak=
go.temporal.io/server v1.24.1 h1:PfLwLNZKFPUFYXDpHvi7fqQC94VAHI3Ssn7bSqYzzCU=
Expand Down
18 changes: 18 additions & 0 deletions temporalcli/commands.workflow_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,3 +646,21 @@ func jsonPath(v any, path ...string) any {
}
return jsonPath(v, path[1:]...)
}

func (s *SharedServerSuite) TestWorkflow_Execute_NullValue() {
// Regression test: see https://github.com/temporalio/cli/pull/617
s.Worker().OnDevWorkflow(func(ctx workflow.Context, input any) (any, error) {
return map[string]any{"foo": nil}, nil
})
res := s.Execute(
"workflow", "execute",
"--address", s.Address(),
"--task-queue", s.Worker().Options.TaskQueue,
"--type", "DevWorkflow",
"--workflow-id", "my-id",
)
s.NoError(res.Err)
out := res.Stdout.String()
s.ContainsOnSameLine(out, "Status", "COMPLETED")
s.ContainsOnSameLine(out, "Result", `{"foo":null}`)
}

0 comments on commit ba831c3

Please sign in to comment.