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

Donation with the same QR won't appear in project donation list #4667

Open maryjaf opened 2 months ago

maryjaf commented 2 months ago

The users be able to donate to a project twice with one QR code In this situation one of these donations is shown in project donations and user donations list

for example these two transaction was made by a QR code and the one of them is shown in project donation table

Transaction ad504d24e7b83b0e22f152b4643361756dcbbee1c4aac0371137b806bf6e6c46

Transaction d02a1bf00da3ffcc344d4700ff2dfadfe3d28bd981a8765565a8fcf27babd305 (it is shown in list of project donation)

cc: @MoeNick

maryjaf commented 2 months ago

https://github.com/Giveth/giveth-dapps-v2/issues/4591#issuecomment-2324064085

Meriem-BM commented 2 months ago

Implementation: After a transaction is detected by the cron job, an additional check is triggered 2 seconds later. This second check searches for any similar transactions that match specific criteria: the same source address, destination address, amount, and (if provided) memo, with a timestamp within 1 minute of the initial transaction. If such a matching transaction is found, a new donation is created.

cc: @maryjaf

maryjaf commented 2 months ago

I think this implementation makes some problem consider this scenario:

@Meriem-BM

maryjaf commented 2 months ago
  • in this case I see two record in donation table for maryam user and my donation in firefox is still shown pending

Two donations are recorded in donation tabel but the user for both of them are shown maryam, but my donation on firefox was with not signed user

maryjaf commented 2 months ago

https://staging.giveth.io/project/test-stellar?tab=donations

image

https://stellar.expert/explorer/public/tx/7e176a3236e3fe867e8a78748ec9ae3975d0cdc5e0d84f0f36c7640fbb3e4356 https://stellar.expert/explorer/public/tx/67b7287c1654cbb511deb1cd25670f0b9f4b18dfc7521759774fe28b4652286b

Meriem-BM commented 2 months ago

Got it, this happened because of using same wallet.

maryjaf commented 2 months ago

Got it, this happened because of using same wallet.

So another condition should be added to prevent this behavior ?

divine-comedian commented 2 months ago

still have some edge cases that needs to find a way - 2 donations with same QR we can add them both, still needs to figure out solution

divine-comedian commented 1 month ago

@Meriem-BM still needs to do research on this