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 balance update delay - Closes #1539 #1609
Conversation
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.
The root cause is that
https://github.com/LiskHQ/lisk-hub/blob/9cf9bab061a430d2cf847828d02d6cfe6c00dea1/src/store/middlewares/account.js#L98
is not called with the same timeout delay as
https://github.com/LiskHQ/lisk-hub/blob/9cf9bab061a430d2cf847828d02d6cfe6c00dea1/src/store/middlewares/account.js#L118
is.
So one solution would be to wrap
https://github.com/LiskHQ/lisk-hub/blob/9cf9bab061a430d2cf847828d02d6cfe6c00dea1/src/store/middlewares/account.js#L98
in a timeout as well.
But IMO a better solution is to use the same solution as in followed accounts middleware. That is to check the store that contains last 10 blocks and update if there is a relevant transaction in last ten blocks.
https://github.com/LiskHQ/lisk-hub/blob/9cf9bab061a430d2cf847828d02d6cfe6c00dea1/src/store/middlewares/followedAccounts.js#L26-L31
It will result in some extra requests but we'll be surer that we have the latest data.
We can try to get rid of it when LiskHQ/lisk-sdk#2403 and core 1.4 that should be fixing this issues is in mainnet.
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.
@michaeltomasik please check with @Efefefef why e2e tests fail with Cannot read property 'balanceBefore' of undefined
error https://dashboard.cypress.io/#/projects/1it63b/runs/4231/failures/f41365b5-6459-4b2a-9213-f78e92616e14
while the same works in
test/cypress/e2e/delegateReg.spec.js
Outdated
@@ -59,9 +59,9 @@ describe('Delegate Registration', () => { | |||
cy.get('@tx').find(ss.transactionReference).should('have.text', '-'); | |||
cy.get('@tx').find(ss.transactionAmountPlaceholder).should('have.text', '-'); | |||
// TODO Unskip when #1539 is fixed |
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.
The TODO comments should be removed.
@michaeltomasik Please change the arrow function to regular function declaration inside 'it'. |
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.
👍
What issue have I solved?
-- #1539
How have I implemented/fixed it?
How has this been tested?
Review checklist