Open WingCH opened 1 year ago
await Future.delayed(const Duration(milliseconds: 100));
is always guaranteed to work?
hard coding a 100 ms
doesn't seem to be very attractive
I have tested on my android and ios device, btw I know it's just a workaround solution.
Author should come up with a better solution
https://github.com/RootSoft/walletconnect-dart-sdk/issues/84#issuecomment-1305987493
fix #84
The problem is caused by the use of
unawaited
, I think it is because thekillSession
request will not have any response and the author wants to runkillSession
and then use_handleSessionDisconnect
to reset the local state immediately. Unfortunately, the actual situation is that the local state is reset before thekillSession
request is sent out, so a validkillSession
request cannot be sent successfully.To reduce the impact on other places, I just add a delay to ensure that the
killSession
request can be sent out before the_handleSessionDisconnect
reset local state.Hope to approve this PR, please let me know if there are any problems 🙏🏻 Thanks so much