-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix npe when memo is not empty #77
Conversation
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com> (cherry picked from commit 7c8f814)
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com> (cherry picked from commit 7c8f814)
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com> (cherry picked from commit 7c8f814)
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com> (cherry picked from commit 7c8f814) Co-authored-by: Andrew Gouin <andrew@gouin.io>
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com> (cherry picked from commit 7c8f814) Co-authored-by: Andrew Gouin <andrew@gouin.io>
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com> (cherry picked from commit 7c8f814) Co-authored-by: Andrew Gouin <andrew@gouin.io>
@@ -370,6 +370,7 @@ func (k *Keeper) RetryTimeout( | |||
} | |||
|
|||
if data.Memo != "" { | |||
metadata.Next = &types.JSONObject{} | |||
if err := json.Unmarshal([]byte(data.Memo), metadata.Next); err != nil { | |||
return fmt.Errorf("error unmarshaling memo json: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm taking a second look at this in the context of osmosis-labs/osmosis#5969. It seems like some packets are returning this error. I think that error should never happen: if the unmarshaling fails we should just return a json object that is a string.
This should in theory be what's happening inside JSONObject.UnmarshalJSON()
, but I think it needs to be reviewed as it only accepts json objects or true/false and not arbitrary strings
* fix npe when memo is not empty * test: add e2e tests for pfm --------- Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: jtieri <justin@thetieris.com>
When next is populated in the forward metadata, a timeout on the forward would cause the timeout to fail to process due to this nil pointer exception.