Skip to content

Commit

Permalink
Specify DiscardUnknown on our history json decoders
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeebswihart committed Oct 30, 2023
1 parent 36312e9 commit 3709d8e
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 20 deletions.
4 changes: 3 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ type HistoryJSONOptions struct {
// not close the reader if it is closeable.
func HistoryFromJSON(r io.Reader, options HistoryJSONOptions) (*historypb.History, error) {
hist := &historypb.History{}
dec := temporalproto.NewJSONDecoder(r)
// We set DiscardUnknown here because the history may have been created by a previous
// version of our protos
dec := temporalproto.NewJSONDecoder(r, true)
if err := dec.Decode(hist); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/datadog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ require (
)

replace (
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a
go.temporal.io/sdk => ../../
)
4 changes: 2 additions & 2 deletions contrib/datadog/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1647,8 +1647,8 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d h1:xETd3gNYJicu9aQYNO9/59uRiYg7n7XJX+uqdIvhYCQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d/go.mod h1:r1sqJqp2hOUjvYU6JwaOw+lcieKyd3HkJ6TZscHsFP4=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a h1:0QeOkeByuuyuyKjsb1s8tw46TcHzPE/IenUxKsfHP0s=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a/go.mod h1:ZMitJTNmbXZkOJENNfv6wSysT4UenqGL918N5N6SH4I=
github.com/tidwall/btree v0.3.0/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8=
github.com/tidwall/btree v1.1.0/go.mod h1:TzIRzen6yHbibdSfK6t8QimqbUnoxUSrZfeW7Uob0q4=
github.com/tidwall/buntdb v1.2.0/go.mod h1:XLza/dhlwzO6dc5o/KWor4kfZSt3BP8QV+77ZMKfI58=
Expand Down
2 changes: 1 addition & 1 deletion contrib/opentelemetry/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ require (
)

replace (
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a
go.temporal.io/sdk => ../../
)
4 changes: 2 additions & 2 deletions contrib/opentelemetry/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d h1:xETd3gNYJicu9aQYNO9/59uRiYg7n7XJX+uqdIvhYCQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d/go.mod h1:r1sqJqp2hOUjvYU6JwaOw+lcieKyd3HkJ6TZscHsFP4=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a h1:0QeOkeByuuyuyKjsb1s8tw46TcHzPE/IenUxKsfHP0s=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a/go.mod h1:ZMitJTNmbXZkOJENNfv6wSysT4UenqGL918N5N6SH4I=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion contrib/opentracing/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ require (
)

replace (
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a
go.temporal.io/sdk => ../../
)
4 changes: 2 additions & 2 deletions contrib/opentracing/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d h1:xETd3gNYJicu9aQYNO9/59uRiYg7n7XJX+uqdIvhYCQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d/go.mod h1:r1sqJqp2hOUjvYU6JwaOw+lcieKyd3HkJ6TZscHsFP4=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a h1:0QeOkeByuuyuyKjsb1s8tw46TcHzPE/IenUxKsfHP0s=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a/go.mod h1:ZMitJTNmbXZkOJENNfv6wSysT4UenqGL918N5N6SH4I=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion contrib/tally/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ require (
)

replace (
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a
go.temporal.io/sdk => ../../
)
4 changes: 2 additions & 2 deletions contrib/tally/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d h1:xETd3gNYJicu9aQYNO9/59uRiYg7n7XJX+uqdIvhYCQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d/go.mod h1:r1sqJqp2hOUjvYU6JwaOw+lcieKyd3HkJ6TZscHsFP4=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a h1:0QeOkeByuuyuyKjsb1s8tw46TcHzPE/IenUxKsfHP0s=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a/go.mod h1:ZMitJTNmbXZkOJENNfv6wSysT4UenqGL918N5N6SH4I=
github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk=
github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/uber-go/tally/v4 v4.1.1 h1:jhy6WOZp4nHyCqeV43x3Wz370LXUGBhgW2JmzOIHCWI=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module go.temporal.io/sdk

go 1.20

replace go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d
replace go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a

require (
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d h1:xETd3gNYJicu9aQYNO9/59uRiYg7n7XJX+uqdIvhYCQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d/go.mod h1:r1sqJqp2hOUjvYU6JwaOw+lcieKyd3HkJ6TZscHsFP4=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a h1:0QeOkeByuuyuyKjsb1s8tw46TcHzPE/IenUxKsfHP0s=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a/go.mod h1:ZMitJTNmbXZkOJENNfv6wSysT4UenqGL918N5N6SH4I=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
Expand Down
2 changes: 1 addition & 1 deletion internal/internal_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ func extractHistoryFromFile(jsonfileName string, lastEventID int64) (*historypb.
}

hist := &historypb.History{}
dec := temporalproto.NewJSONDecoder(reader)
dec := temporalproto.NewJSONDecoder(reader, true)
if err := dec.Decode(hist); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
)

replace (
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d
go.temporal.io/api => github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a
go.temporal.io/sdk => ../
go.temporal.io/sdk/contrib/opentelemetry => ../contrib/opentelemetry
go.temporal.io/sdk/contrib/opentracing => ../contrib/opentracing
Expand Down
4 changes: 2 additions & 2 deletions test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d h1:xETd3gNYJicu9aQYNO9/59uRiYg7n7XJX+uqdIvhYCQ=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231027221743-bfe668b5925d/go.mod h1:r1sqJqp2hOUjvYU6JwaOw+lcieKyd3HkJ6TZscHsFP4=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a h1:0QeOkeByuuyuyKjsb1s8tw46TcHzPE/IenUxKsfHP0s=
github.com/tdeebswihart/temporal-api-go v0.0.0-20231030163055-872ab2d7375a/go.mod h1:ZMitJTNmbXZkOJENNfv6wSysT4UenqGL918N5N6SH4I=
github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk=
github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/uber-go/tally/v4 v4.1.1 h1:jhy6WOZp4nHyCqeV43x3Wz370LXUGBhgW2JmzOIHCWI=
Expand Down

0 comments on commit 3709d8e

Please sign in to comment.