wallet-provider icon indicating copy to clipboard operation
wallet-provider copied to clipboard

Post transaction becomes unusable when user is inactive

Open soueuls opened this issue 2 years ago • 4 comments

Hello,

I have a generic hook used to post a transaction. It's fairly simple for now.

export const useTx = (opts: CreateTxOptions) => {
  const connectedWallet = useConnectedWallet();
  const wallet = useWallet();
  const { fee } = useEstimateFee(opts);

  const { mutateAsync: submit, ...rest } = useMutation(() => {
    if (!connectedWallet) {
      throw new Error("Wallet is not connected");
    }

    return wallet.post(opts)
  });

  return {
    submit,
    canSubmit: !!fee,
    ...rest,
  };
};

The problem is that, after X minutes (I am still not sure if X is fixed or not) being inactive on the page. Then wallet.post becomes unusable. The promise is neither fulfilled neither rejected. Nothing happen, the Terra Station popup does not show up.

I then need to refresh the page to be able to post a transaction. I thought it was coming from my code (it's always the most likely) but I dig into the problem, and I am more and more convinced that the problem comes from this specific function wallet.post

I have worked on Astroport and I am currently working on Prism, I haven't been able to figure out what's the root cause so I willing to jump on a call with a maintainer, make myself available as much as possible to solve it, if we find out about the problem, I am also willing to contribute to fix this bug.

soueuls avatar Sep 02 '22 06:09 soueuls

Hi @soueuls ,

We are having the same issues with wallet.post. We have been trying to pinpoint the error but it seems it is too random. Are you using any other wallet extension like Keplr along with Terra station?

thandaanda avatar Oct 06 '22 05:10 thandaanda

I have exact same issue. Any solution for this except refreshing?

icetrust0212 avatar Nov 03 '22 18:11 icetrust0212

I haven't been able to fix this yet. Anyone else suffering from this? Did you find a solution?

soueuls avatar Nov 08 '22 07:11 soueuls

This is still happening in version 3.8.1

matpb avatar Apr 17 '23 19:04 matpb