Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
61 stars 34 forks source link

refreshed the donation page and got an application error #4557

Open GriffGreen opened 1 month ago

GriffGreen commented 1 month ago
Screenshot 2024-08-12 at 10 01 17 PM
jainkrati commented 1 month ago

@maryjaf @RamRamez could you please take a look at this issue : how frequently it happens ? what is the cause ? deploy the fix sooner

HrithikSampson commented 4 weeks ago

I was able to reproduce this issue using URL Throttler extension and setting a delay to https://rpc.walletconnect.org/* for a long time while refreshing the page and I clicked on select Token very quickly along with that I added additional throttling in chrome dev tools then I got the following error in giveth.io

Screenshot 2024-08-15 at 3 20 42 PM

Similarly In localhost I got the following error

Screenshot 2024-08-15 at 6 31 57 PM

It is most probably because the balances are fetched using useFetchBalance of each token , so each token Balanced is fetched and since it calls react hooks . Sometimes the useFetchBalance hooks can be called in a disorderly fashion or can be called fewer times than its previous render.

divine-comedian commented 2 weeks ago

@HrithikSampson - What is the update on this issue?

HrithikSampson commented 2 weeks ago

Hi @divine-comedian ,

I was facing errors while trying to solve it. There was one solution where I was able to get resolve the error but it was causing many rerenders to to the page.

I will try another solution to it. I am not sure whether it will work.

HrithikSampson commented 2 weeks ago

Hi @RamRamez @divine-comedian ,

I was getting a react queueing issue previously(it wasnt coming all the time) but after a small change the queueing issue disappeared. I cant see it now but I am not sure why it isnt coming. I tried it multiple times and it isnt coming.

I was getting this error: Should have a queue. This is likely a bug in React. Please file an issue

kkatusic commented 2 weeks ago

@HrithikSampson, cc @divine-comedian, maybe this is caused ny same issue that Ashley reported, searching inside input field for token. If that is true @lovelgeorge99 is handling this.

HrithikSampson commented 2 weeks ago

@kkatusic ,

I think root cause might be the same.

I just wanted to inform that I am not seeing any error coming while clicking select Token Modal while refreshing now. But I am getting the error which Ashley reported while searching for the tokens.

@divine-comedian, I think that if the error is resolved while searching for the tokens, this error will also be resolved along with it.

divine-comedian commented 2 weeks ago

seems that @lovelgeorge99 and @HrithikSampson are working on two similar bugs in the same file, we should coordinate the changes and make sure both bug reports cannot be reproduced once we implement all fixes

please coordinate with @jainkrati if either of you have code questions.

HrithikSampson commented 1 week ago

@maryjaf @LatifatAbdullahi , This issue is ready to be tested. I have also resolved this comment https://github.com/Giveth/impact-graph/issues/743#issuecomment-2324300583

LatifatAbdullahi commented 1 week ago

Currently unable to reproduce the error after refreshing the donation page multiple times.

divine-comedian commented 1 week ago

@LatifatAbdullahi I think to reproduce this error you not only need to refresh/load the page but also open the token select drop down menu. it appears it happens when you try to load the page and open the token modal very quickly.

If you're no longer able to repro the issue then we can move it to DONE

LatifatAbdullahi commented 1 week ago

@divine-comedian Yes you are right, I tried that as well and still not reproducible

https://github.com/user-attachments/assets/1d537b8e-a7b5-4eab-9208-07289ceab138

kkatusic commented 1 week ago

@LatifatAbdullahi I think this issue was related to input token search hook , @HrithikSampson solved that problem yesterday and push hotfix to production. Why I think that is the same, same error was occurring.

LatifatAbdullahi commented 1 week ago

@HrithikSampson @kkatusic

Thanks! I just retested on production but couldnt reproduce it. The only anomaly I have noticed is the slight glitch when refreshing both on stage and production. @divine-comedian what do you think?

https://github.com/user-attachments/assets/e74f259c-5b5a-4188-a973-775ebbdb47e3

divine-comedian commented 1 week ago

Follow up in #4686

@LatifatAbdullahi could you confirm if the token list is NOT loading or rather if it is loading very slow? Try leaving the token list drop down menu open for longer and see if it eventually loads.

At any rate let's mark this issue as DONE and follow up in the linked issue