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

Agent, Finance: token balances module doesn't live update #1062

Open
izqui opened this issue Jan 7, 2020 · 5 comments
Open

Agent, Finance: token balances module doesn't live update #1062

izqui opened this issue Jan 7, 2020 · 5 comments

Comments

@izqui
Copy link
Contributor

izqui commented Jan 7, 2020

I just did an ANT deposit into an org while Finance was open. As soon as the transaction was mined, the transfer appeared in the transfer ledger, but the balance on top didn't update until I forced a refresh

Before refreshing (as soon as the deposit was mined):

Screen Shot 2020-01-07 at 11 31 36 AM

After reloading the app:

Screen Shot 2020-01-07 at 11 32 13 AM

@sohkai
Copy link
Contributor

sohkai commented Jan 14, 2020

Hmm, this is quite awkward and shouldn't be the case. Maybe there's something weird with how we're memoizing but the balances should definitely be updating.

@rperez89
Copy link
Contributor

finance.gif

Couldn't reproduce this one @sohkai @izqui , any particular way to test this?

@sohkai
Copy link
Contributor

sohkai commented Apr 12, 2020

@rperez89 Now I'm suspecting this may be due to race conditions with the underlying ETH node (e.g. we got the event first, but then when we did the balance update via an eth_call, we didn't catch the update).

Here's what I would do to fix this:

  • Send an API trigger from the frontend every 30s so the script can update all of its tokens' balances

This also has the nice side-effect of catching updates for any "hidden" transfers (e.g. directly sending tokens to the Agent / Vault).


Note that we should also apply this same trick to the Agent app.

@sohkai sohkai changed the title Finance: token balances module doesn't live update Agent, Finance: token balances module doesn't live update Apr 12, 2020
@rperez89
Copy link
Contributor

ahh about that nice side effect that you are talking about, i did exactly that to test i sent eth directly to the vault.

@cleanunicorn
Copy link

This also happens if you deploy a token, mint, approve and deposit in the same transaction.

The tokens appear in the transfer ledger, but the withdraw is not possible.

This isn't fixed on a hard refresh.

@sohkai How should I send an API request to force a refresh? Currently testing on Rinkeby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants