Giveth / giveth-next

Giveth 2.0 implementation in NextJS
https://next.giveth.io
GNU General Public License v3.0
20 stars 13 forks source link

If the backend is down, there should be a popup for the user before they donate explaining that they may not get GIVbacks #605

Open laurenluz opened 2 years ago

laurenluz commented 2 years ago

To avoid any issues that arise from not being able to track donations when the backend is down, the frontend should know when the backend is down.

If the backend is down and the user tried to donate to a verified project, when they click "DONATE" they get a modal that says:

" We are currently experiencing technical difficulties. If you donate now, you donation may not be stored in our database and you may not get GIVbacks. Please try again later or accept and proceed with your donation."

And there's a check box that says "I acknowledge that I may not receive GIVbacks for this donation"

If the button is checked then the "Proceed" button turns pink and they are able to donate.

If they do not check the button, they can close the modal and do nothing.

MoeNick commented 2 years ago

This problem may occur after the donation is built, so at the time the trx is went through the network we may dont have any problem, but after the confirmation of trx from network we may have a lost connection. In this case we have to log the failure to another server to calculate the givback manually or by a script. Ideas @mohammadranjbarz @CarlosQ96 and @mateodaza ?

mohammadranjbarz commented 2 years ago

This problem may occur after the donation is built, so at the time the trx is went through the network we may dont have any problem, but after the confirmation of trx from network we may have a lost connection. In this case we have to log the failure to another server to calculate the givback manually or by a script. Ideas @mohammadranjbarz @CarlosQ96 and @mateodaza ?

My idea is that we should see it as simple as possible, so my solution: When creating donation request fails, frontend should save the donation info in localStorage and in intervals retry it, and if the donation will be in local storage, after closing tabs by user, and open it again, frontend can check it to see if there is failed requests in local storage , retry it

markoprljic commented 2 years ago

For this and similar modals and popups, we have a Modal component in the design system that can and should be used for these and similar situations, unless we have to design a custom modal for something specific. In this case, @MoeNick please make sure devs use the modal component and change the content of it to accommodate this scenario. Thanks.

MoeNick commented 2 years ago

I think this issue was misunderstood, it's a technical thing not related to UX, the problem is happening when we don't know backend is down, if we knew yes we should have a model and prevent the user go ahead. But in this case we are following other issues to retry the missed transactions add logs : #633