GoodDollar / GoodDAPP

GoodDollar.org Wallet is the simplest access point to Claim your daily G$. It Is based on web3 and React native web.
good-dapp.vercel.app
MIT License
106 stars 55 forks source link

[BUG] Completed Payment feed card showing as pending after executing the TX #4117

Closed vldkhh closed 11 months ago

vldkhh commented 1 year ago

[BUG] Completed Payment feed card showing as pending after executing the TX

Also reproduced on prod!

Preconditions: 2 accounts available

Steps: 1) send a tx from 1st to 2nd account 2) open the payment link via 2nd account 3) observe the result for both accounts

Actual result: The feed tx card is showing as pending on the account who sent the amount The feed tx card showing as completed on the account who received the amount

Expected result: The feed tx cards show as red and green after executing the payment for both accounts

Env: dev.gooddollar.org 2.25.0

Device: Windows 10 // Google Chrome

Attachments:

Private Zenhub Video

Private Zenhub Image

sirpy commented 1 year ago

@L03TJ3 this is a bug, because we no longer listen to "withdraw" events of payment links. as we rely on the TX history from the explorers API. The explorer API is only able to give us TX the user did, but the withdraw is done by the recipient. We need to also query the logs for withdraw from the explorers API https://docs.blockscout.com/for-users/api/rpc-endpoints/logs https://docs.celoscan.io/api-endpoints/logs The logs needs to be filtered with the "from" equal to the user (ie sender)

event PaymentWithdraw(
        address indexed from,
        address indexed to,
        address indexed paymentId,
        uint256 amount
    );

Thats means that topic0 should equal the event hash 0x39ca68a9f5d8038e871ef25a6622a56579cda4a6eedf63813574d23652e94048 and topic1 should equal the bytes32 padded address of the user. see fo example: image

vldkhh commented 11 months ago

@L03TJ3 it still shows as pending

L03TJ3 commented 11 months ago

@vldkhh did you test it with a new payment? or are you looking at an older one?

vldkhh commented 11 months ago

verified on prod

vldkhh commented 11 months ago

@L03TJ3 please re-check this, looks like latest fixes broke something. It still reproduces with send via link Private Zenhub Image

sirpy commented 11 months ago

@vldkhh i dont understand the image. Also please describe the exact flow to reproduce and explain the new issue, because from what I understand the previous flow you described is fixed, but now you experience something new.

vldkhh commented 11 months ago

@sirpy The flow is the same as described above. Completed Payment feed card showing as pending after executing the TX. And it reproduces only with the "SEND via LINK" method. It was fixed last week but not it still showing as pending for me

Steps: 1) send a tx via Link from 1st to 2nd account 2) open the payment link via 2nd account 3) observe the result for both accounts

Expected: The feed tx card is showing as pending on the account who sent the amount Actual: The feed tx card showing as completed on the account who received the amount

vldkhh commented 11 months ago

@sirpy

Private Zenhub Video

sirpy commented 11 months ago

@L03TJ3 vlad is now showing that regular payment links are not being updated, you shared a video of a receive link. That suggests that the update you did for checking withdraw events is not fully working, or has some kind of a bug. Please debug it.

L03TJ3 commented 11 months ago

@sirpy yes placed the vid on wrong ticket

vldkhh commented 11 months ago

looks like it was a cache issue, it working fine now