Skip to content
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

Merged
merged 3 commits into from
Aug 3, 2023
Merged

fix npe when memo is not empty #77

merged 3 commits into from
Aug 3, 2023

Conversation

agouin
Copy link
Member

@agouin agouin commented Jul 29, 2023

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.

@jtieri jtieri marked this pull request as ready for review August 3, 2023 01:12
@jtieri jtieri merged commit 7c8f814 into main Aug 3, 2023
@jtieri jtieri deleted the andrew/fix_timeout_npe branch August 3, 2023 18:17
@agouin agouin added the BACKPORT Backport into maintained branches label Aug 6, 2023
mergify bot pushed a commit that referenced this pull request Aug 6, 2023
* 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)
mergify bot pushed a commit that referenced this pull request Aug 6, 2023
* 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)
mergify bot pushed a commit that referenced this pull request Aug 6, 2023
* 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)
agouin added a commit that referenced this pull request Aug 7, 2023
* 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>
agouin added a commit that referenced this pull request Aug 7, 2023
* 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>
agouin added a commit that referenced this pull request Aug 7, 2023
* 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)
Copy link
Contributor

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

xlab pushed a commit to persistenceOne/ibc-apps that referenced this pull request Jan 9, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BACKPORT Backport into maintained branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants