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
62 stars 33 forks source link

Stellar | Check pending donation onchain on specific events #4573

Closed MoeNick closed 1 month ago

MoeNick commented 2 months ago

Was talking to @Meriem-BM to seek for a live solution to detect in seconds, or we run one manual fetch data before

Originally posted by @MoeNick in https://github.com/Giveth/giveth-dapps-v2/issues/4422#issuecomment-2288782804

MoeNick commented 2 months ago

FYI: @maryjaf

Meriem-BM commented 2 months ago

@maryjaf this one ready for test.

maryjaf commented 2 months ago

@maryjaf this one ready for test.

Could you please tell me more about this new change and behavior? actually what changes was made in this page? image

Meriem-BM commented 2 months ago

@maryjaf user might make a donation in last minutes, or scan QR code and tries to go back which will mark it as failed, and since we refresh UI every 5 mins when user is waiting for status update it might be missed, so we added fetching updated status on certain events (when time is up, when user try raising a ticket, or hen going back) to avoid any mismatch and get last status before those events.

maryjaf commented 2 months ago

when time is up

https://github.com/user-attachments/assets/791f5b78-0739-4c10-952c-b299da46acb5

and after about 2 mins I see the below pic

image

maryjaf commented 2 months ago
MoeNick commented 2 months ago

For 2 I think we can do it while loading the page if @Meriem-BM agrees.

maryjaf commented 2 months ago

when user try raising a ticket,

my question is that if the showing pending status in this scenario is correct when the the time is over and there is no donation?

https://github.com/user-attachments/assets/4fe65443-96ac-4991-87cc-074e4e3c8df0

maryjaf commented 2 months ago

when user try raising a ticket,

  • [ ] 3- in this case the time is over and user hasn't donated to the project, the behavior is like below record
  • after the time is over, the related request is called and the status is pending
  • when I tap on the "raise a ticket" the request is called and the status is pending

my question is that if the showing pending status in this scenario is correct when the the time is over and there is no donation?

Screen.Recording.2024-08-20.at.11.58.21.AM.mov

[ ] 1- it seems there is a problem in this case (when time is up), as you can see in below video after the time is over this request, operationName:"GetDonationById" hasnot been called

kindly reminder

MoeNick commented 2 months ago

For 3 - the status should change to failed when the time is up, A manual check on this event could only change the status to success if there's a donation is detected on-chain within the 5 min intervals. @maryjaf For better testing please youse different amounts. FYI: @Meriem-BM

maryjaf commented 2 months ago
  • 3- in this case the time is over and user hasn't donated to the project, the behavior is like below record
  • after the time is over, the related request is called and the status is pending
  • when I tap on the "raise a ticket" the request is called and the status is pending

Is there an update related to this item?

Meriem-BM commented 2 months ago

when user try raising a ticket,

  • [ ] 3- in this case the time is over and user hasn't donated to the project, the behavior is like below record
  • after the time is over, the related request is called and the status is pending
  • when I tap on the "raise a ticket" the request is called and the status is pending

my question is that if the showing pending status in this scenario is correct when the the time is over and there is no donation?

Screen.Recording.2024-08-20.at.11.58.21.AM.mov

@maryjaf the cron job runs every minute to get transactions on stellar, so I make sure to not mark any donation as failed when time is up until one minute passes, to make sure if any donation detected in next minute, because the user might donation in last minute on seconds. if you wait 1 min it will be changed to failed.