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

Get user transactions from database instead of redux state #2127

Merged
merged 28 commits into from
Jul 29, 2024

Conversation

chmanie
Copy link
Member

@chmanie chmanie commented Apr 3, 2024

Description

Sorry for another big one :(

This PR moves the transaction state to Apollo, from redux. It does not remove sagas but it enables a path forward to refactor this gradually. All sagas should still work, except that the transaction state is read from the Apollo cache / the database as opposed to redux.

Redux as a whole also wasn't removed yet, as some of the sagas depend on other parts of the state, still (like gas prices estimation). This can be done in a follow-up PR.

Another thing that isn't in scope is the fix of the transactions list paging (didn't work before), for that I'm going to open yet another PR.

I used optimistic UI updates for the transaction updates so that changes should be reflected as fast as before.

Testing

Basically everything should work as before. Please create some transactions and/or bigger transaction groups to test this.

Diffs

Changes 🏗

  • All redux transaction state now lives in Apollo

Deletions ⚰️

  • Lots of transaction related redux state management boilerplate

Resolves #2171

@chmanie chmanie force-pushed the feat/apollo-tx branch 4 times, most recently from def62f7 to e3828c1 Compare April 17, 2024 17:11
@chmanie chmanie force-pushed the feat/apollo-tx branch 8 times, most recently from c1c1e6c to b5c10e2 Compare May 2, 2024 19:44
@chmanie chmanie marked this pull request as ready for review May 6, 2024 12:50
@chmanie chmanie requested review from a team as code owners May 6, 2024 12:50
@chmanie chmanie force-pushed the feat/apollo-tx branch 3 times, most recently from 831dcdd to c423c1a Compare May 8, 2024 19:12
@chmanie chmanie mentioned this pull request May 9, 2024
Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

Great effort went into this PR, nice work @chmanie!

I spotted a potential regression when a tx fails:

  • on master, it expands the error details:
Screen.Recording.2024-05-10.at.13.52.05.mov
  • whereas on this branch it doesn't happen:
Screen.Recording.2024-05-10.at.13.55.52.mov

@chmanie
Copy link
Member Author

chmanie commented May 14, 2024

Great effort went into this PR, nice work @chmanie!

I spotted a potential regression when a tx fails:

* on `master`, it expands the error details:

Screen.Recording.2024-05-10.at.13.52.05.mov

* whereas on this branch it doesn't happen:

Screen.Recording.2024-05-10.at.13.55.52.mov

Thanks for the review @jakubcolony! I'll take care of it asap.

@chmanie chmanie requested a review from a team as a code owner May 20, 2024 09:44
@chmanie chmanie force-pushed the feat/apollo-tx branch 2 times, most recently from cb7404e to 3e6762f Compare May 24, 2024 14:51
@chmanie
Copy link
Member Author

chmanie commented May 24, 2024

@jakubcolony can you take another look maybe? Thank you!

@jakubcolony jakubcolony self-requested a review May 30, 2024 17:33
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.

Nice job Chris! Completed pill issue is resolved:

Screen.Recording.2024-07-29.at.09.25.48.mov

I have found one issue, but it might also exist on master.

I created a mint tokens action, but rejected the first transaction. I then retried it from the userhub, this time accepting the transaction, but the "Claim pending transactions" part never triggered. This left the "Pending 1/2" pill spinning forever, even after a refresh, and there is no way to retry it from the userhub.

Screenshot 2024-07-29 at 09 28 53

@iamsamgibbs
Copy link
Contributor

Just tested this on master - it does behave the same, except the "pending" pill disappears after a refresh. I think the change here to show the "pending" pill after a refresh makes sense as there are still pending transactions, but I wouldn't be surprised if we find more stuck "pending" pills in other areas of the app.

@chmanie
Copy link
Member Author

chmanie commented Jul 29, 2024

Oh yeah that's definitely something that needs to be fixed but can't be in the current state. As a matter of fact, the transaction API refactor that I'm working on will fix this issue.

Copy link
Contributor

@davecreaser davecreaser left a comment

Choose a reason for hiding this comment

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

Nice one Chris, everything is still looking good to me. Played around a little locally again to be sure and couldn't spot any regressions.

Let's go! 🎉

@chmanie chmanie merged commit 8801462 into master Jul 29, 2024
4 of 6 checks passed
@chmanie chmanie deleted the feat/apollo-tx branch July 29, 2024 09:55
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.

Move transaction list to Apollo entirely
6 participants