-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore EOF errors in jsonEncoding.Unmarshal()
#1188
Ignore EOF errors in jsonEncoding.Unmarshal()
#1188
Conversation
jjtimmons seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
data
data
jsonEncoding.Unmarshal()
closing because I don't like seeing this sit open in my PRs page, still think ya'll should do it |
re-opening for review by the Cadence team |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@jjti could you review the Contributor License Agreement? Thanks! |
What changed?
EOF
errors, leaving the undecodedobjs
Zero-valuedI expect this will better align with user expectations. For example, if you
json.Unmarshal
a 0-length JSON array into a 1-length slice of struct pointers, the pointer remains zero'ed without err: https://go.dev/play/p/ppz62H1Pqpwhttps://pkg.go.dev/encoding/json#Unmarshal:~:text=To%20unmarshal%20a%20JSON%20array%20into%20a%20Go%20array
Why?
I've found that the Cadence Replayer fails on many of my team's Workflows:
Ie we're getting:
unable to decode argument: 0, *interface {}, with json error: EOF
in Cadence Replayer where the Workflows happily succeed in our production code. Others have noticed the same: #1016This happens when we pass an
interface{}
to afuture.Get(ctx, value)
(as a throw away value, we don't actually expect a result):How did you test it?
make test
Potential risks
EOF
errors fromUnmarshal
indecoder.defaultDataConverter(data []byte, to ...interface{})
. Eg: it's expected that we'll error out onUnmarshal
and that all response values will be set to non-Zero values