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

Prevent user positions from flickering #104

Open
JaniAnttonen opened this issue Mar 31, 2021 · 9 comments · Fixed by #144 · May be fixed by #203
Open

Prevent user positions from flickering #104

JaniAnttonen opened this issue Mar 31, 2021 · 9 comments · Fixed by #144 · May be fixed by #203
Labels
bug Something isn't working

Comments

@JaniAnttonen
Copy link
Member

An uncommon bug, but sometimes user positions can flicker in and out of view. This might be due to rate-limited queries to Alchemy, or conflicting account queries (dangling info on connected wallets)

@JaniAnttonen JaniAnttonen added the bug Something isn't working label Mar 31, 2021
@JaniAnttonen
Copy link
Member Author

I'm pretty sure now that it is rate limiting that does this. Things to add to VNL 2.0: aggregate queries for owned tokens.

@JaniAnttonen
Copy link
Member Author

One way to tackle this could be to use websockets instead of http: https://docs.alchemyapi.io/alchemy/guides/using-websockets

@ricardojmendez
Copy link
Contributor

Assuming this is what I'm seeing myself: the main issue is not that positions flicker, but that they show up as empty. It might freak users out in a way that a Loading message wouldn't.

@ricardojmendez
Copy link
Contributor

Seeing a bunch of errors in the console, starting with a few:

Failed to load resource: the server responded with a status of 429 ()

Then followed by

Uncaught (in promise) Error: bad result from backend (method="call", params={"transaction":{"from":"[WALLET ADDRESS]","to":"0x1017B147b05942EAd495E2ad6d606EF3C94B8FD0","data":"[ELIDED]"},"blockTag":"latest"}, result=undefined, error={}, code=SERVER_ERROR, version=providers/5.0.23)
    at f.makeError (c8d6726499572198c6e02c291313dbe5d949bb95.34bfb3b722fcc8783046.js:1)
    at f.throwError (c8d6726499572198c6e02c291313dbe5d949bb95.34bfb3b722fcc8783046.js:1)
    at Tt.<anonymous> (c8d6726499572198c6e02c291313dbe5d949bb95.34bfb3b722fcc8783046.js:1)
    at Generator.next (<anonymous>)
    at a (c8d6726499572198c6e02c291313dbe5d949bb95.34bfb3b722fcc8783046.js:1)

I had the tab open, though so those might be from previous attempts.

@ricardojmendez
Copy link
Contributor

The most recent errors are a cluster of

resource: the server responded with a status of 429 ()
eth-mainnet.alchemyapi.io/v2/X1C1rFeXh017nNEUgw3-P3kDT2KiOlKh:1 Failed to load resource: the server responded with a status of 429 ()

Followed by a bunch of

3188ec84.7c497e41be2b52b11d1f.js:1 POST https://eth-mainnet.alchemyapi.io/v2/X1C1rFeXh017nNEUgw3-P3kDT2KiOlKh 429

@ricardojmendez
Copy link
Contributor

Page refresh.

3188ec84.7c497e41be2b52b11d1f.js:1 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 latest listeners added. Use emitter.setMaxListeners() to increase limit
    at Od (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:739479)
    at Fd.wd.addListener (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:741782)
    at Fd.wd.once (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:741957)
    at https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:745139
    at new Promise (<anonymous>)
    at Fd.getLatestBlock (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:745118)
    at https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:771740
    at Pp.middleware (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:770231)
    at Pp.handleRequest (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:766276)
    at t (https://vanilladefi.com/_next/static/chunks/3188ec84.7c497e41be2b52b11d1f.js:1:765044)

Screenshot 2021-04-09 at 07 13 31

@ricardojmendez
Copy link
Contributor

It behaves slightly different after Advanced HODL mode. It will:

  • First show no positions;
  • Then show a mostly empty position, with only HTRS filled in;
  • Then fill in all the data.

@JaniAnttonen
Copy link
Member Author

Yeah, not surprising since the HODL mode updates reduced the amount of requests made to Alchemy so it rate limits less :D

@ricardojmendez
Copy link
Contributor

I'm still getting this issue. I don't visit VanillaDefi.com that often, so can't say if it's been there in the last few weeks, but it's happening constantly today with the same error.

POST https://eth-mainnet.alchemyapi.io/v2/X1C1rFeXh017nNEUgw3-P3kDT2KiOlKh 429

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
2 participants