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

Successful donations not routing to success page #4361

Closed divine-comedian closed 4 days ago

divine-comedian commented 5 days ago

When making a successful donation on giveth STAGING I am shown the donate modal with the success toast message but the app is not routing afterwards to the success page.

@Meriem-BM did some investigation and found these results:

The problem is with the function getTxFromSafeTxId that throws this error

Image

Image

I think it's related to the Multisig changes, since this function wasn't being called before

Some changes were made into this file useSafeAutoConnect so this condition is being fulfilled for some new cases

const handleSaveDonation = async (
…
if (isSafeEnv) {
                safeTransaction = await getTxFromSafeTxId(txHash, chainId!);
                if (safeTransaction) {
                    donationData = {
                        chainId: chainId!,
                        amount: amount,
                        token,
                        projectId,
                        anonymous,
                        chainvineReferred,
                        walletAddress: safeTransaction?.safe as `0x${string}`,
                        symbol: token.symbol,
                        setFailedModalType,
                        safeTransactionId: txHash,
                        draftDonationId,
                    };
                } else {
                    return null;
                }
            }

And this function getTxFromSafeTxId throwing some error and returning null so isSaved is false and the model is not closing neither the user being redirected, I don’t know much why the endpoint is failing, or understand the feature much, but that’s the issue So I thought those changes might have introduced some edge cases.

divine-comedian commented 4 days ago

Looks like it's been fixed! Tested it out and it is working properly now