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 updating transactions list #1942

Open
lukaw3d opened this issue May 20, 2024 · 3 comments
Open

Fix updating transactions list #1942

lukaw3d opened this issue May 20, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@lukaw3d
Copy link
Member

lukaw3d commented May 20, 2024

Current behavior:

  • make a new transaction and request balance and transactions from oasisscan
  • request balance from oasisscan every 30 seconds
  • if balance changes, request transactions from oasisscan
  • request balance from oasisscan every 30 seconds
  • if balance changes, request transactions from oasisscan
  • request balance from oasisscan every 30 seconds
  • if balance changes, request transactions from oasisscan
    ...

Issue:
Immediately after making a transaction oasisscan responds with old balance and old transactions. After 30 seconds oasisscan responds with changed balance, and then with old transactions. After 30 seconds balance is not changed, so we do not try to get new transactions. Wallet is stuck showing old transactions, missing the new transaction.

Solutions:

  • maybe just add 15 second delay to fetching transactions after balance changes (delay might be different on testnet)
  • fetch transactions every time. Adds overhead to oasisscan backend
  • ignore balance change until transactions change
@lukaw3d lukaw3d added the bug Something isn't working label May 20, 2024
@lubej lubej self-assigned this May 23, 2024
@lukaw3d
Copy link
Member Author

lukaw3d commented May 30, 2024

Another issue: debonding transactions don't change "available" balance so this is ignored

if (staleAvailableBalance !== refreshedAccount.available) {

@lukaw3d
Copy link
Member Author

lukaw3d commented May 31, 2024

Adding a 15 second delay is too low
Checked the delay:

  • made a transfer
  • +9 seconds
  • balance updated
  • +22 seconds
  • transactions updated
setInterval(async () => {
  const acc = await (await fetch('https://api.oasisscan.com/mainnet/chain/account/info/oasis1qz78ap0456g2rk7j6rmtvasc9v2kjhz2s58qgj90')).json()
  const txs = await (await fetch('https://api.oasisscan.com/mainnet/chain/transactions?size=1&address=oasis1qz78ap0456g2rk7j6rmtvasc9v2kjhz2s58qgj90&runtime=true')).json()
  console.log(new Date().toISOString(), acc.data.available, txs.data.list[0].txHash)
}, 1000)

@lukaw3d
Copy link
Member Author

lukaw3d commented Jun 1, 2024

Retried:

  • transfer
  • +8 seconds
  • balance and transactions updated

and on testnet

  • transfer
  • +6 sec
  • balance updated
  • +31 sec
  • transactions updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants