Closed klassare closed 1 year ago
We investigated this issue and those are the findings:
destroy
method. In the past, I feel like the button did at times not properly reset & refresh the page (potentially the delay mentioned here), but after all of the other fixes have been merged, I could no longer reproduce it. I also made a change to the UI to disable the button after clicking it, so we have better visual feedback.destroy
method does a couple of things to clean up. Besides removing local storage entries, it also disconnects the transport and waits for this action to be done. The problem is that we can't really control what happens internally, eg. inside the signClient. When we call await signClient.core.pairing.disconnect({ topic: pairing.topic })
, if this hangs for some reason, then the await client.destroy()
will also hang. If we don't await everything internally, then we run into the risk that not everything is cleaned up and "ready" when the destroy resolves.Unless we can reliably reproduce the error and pinpoint exactly what is causing the delay, I think we have to keep it as it is, unless anyone has another suggestion.
BTW: The PR linked in this issue does not directly address this issue, because of the points mentioned above. However, it does address another issue where the destroy method could resolve while not everything was cleaned up internally.
Hi @klassare, the issue was caused by some promises that weren't resolving "on time". With #639 we now await the termination of each instruction. This fix however will be available in the next build. Relevant lines of code: Check PR #639
Looks like #639 fixes it
Describe the bug (current behavior) In some situations
client.destroy()
has an inconvenient delay. This can cause issues for logic that depends on the client first being destroyed. For example like with the "reset & refresh" button in the example dapp.To Reproduce Steps to reproduce the behavior:
Expected (correct) behavior
destroy()
should always resolve within a few secondsEnvironment
Additional context Branch: feat/transport-kukai-wc2