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

Hotfix: Handle Bridge drains history when no receipt is available #3229

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

jakubcolony
Copy link
Collaborator

Description

Thanks to @Nortsova for alerting me of an issue she ran across when off-ramping her crypto. Once the transfer was picked up by Bridge, the drains history disappeared in the UI as the bridgeGetDrainsHistory query started returning an error. After a while, the issue went away and drains history was visible again.

I looked through the logs and realised it was trying to read the drain receipt's URL, but it was not available:

bridgeXYZMutation handler getDrainsHistoryHandler failed with error: TypeError: Cannot read properties of undefined (reading 'url')

Most likely, when a new transfer is created, the receipt is not available immediately but only after a few minutes or so.

This PR changes the getDrainsHistory handler to gracefully handle a case where there's no receipt as well as introduces an extra state in the UI.

Testing

I could not test it even when connected to prod, it's an intermittent issue that only reproduces under the right circumstances.

I attached all the investigation details above in a hope this justifies my fixes.

Also, here's a screenshot from local dev connected to Bridge prod, just to prove the drains history still works:
image

@jakubcolony jakubcolony self-assigned this Sep 30, 2024
@jakubcolony jakubcolony marked this pull request as ready for review September 30, 2024 21:59
@jakubcolony jakubcolony requested review from a team as code owners September 30, 2024 21:59
iamsamgibbs
iamsamgibbs previously approved these changes Oct 1, 2024
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes all look sensible, nicely done!

The only thing I would suggest, is that if we know we will definitely get the receipt at some point, maybe the wording could be "Receipt not yet available", or if that is too long maybe just "Pending"?

@jakubcolony
Copy link
Collaborator Author

Hey @iamsamgibbs, I've checked in with Mel and updated the copy to "Generating...":

image

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this with and offer of trying of reproducing this in production :)

Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes all look like they should solve the issue, so 🤞 they do.
Nice job going into the trenches and solving the issue 💯

@jakubcolony jakubcolony merged commit 3964dfe into master Oct 15, 2024
4 of 6 checks passed
@jakubcolony jakubcolony deleted the hotfix/bridge-drains-history branch October 15, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants