WalletConnectSwiftV2 icon indicating copy to clipboard operation
WalletConnectSwiftV2 copied to clipboard

Crash [Dispatcher.protectedSend] most frequent

Open skibinalexander opened this issue 10 months ago • 4 comments

Describe the bug

Concurrency/CheckedContinuation.swift:187: Fatal error: SWIFT TASK CONTINUATION MISUSE: protectedSend(:) tried to resume its continuation more than once, throwing webSocketNotConnected!

Hello team. At the moment we have the most popular thefts in our app using your library. This is already a critical value for our crash free. We have 2 crash reports from Crashlytics for research. We have not been able to solve our problem for a long time and we see that the problem is part of the problem of the library, we look at the web socket synchronization service through the async / await swift instruments.

SDK Version

To Reproduce Steps to reproduce the behavior:

  • Using a direct library script

Expected behavior We expect stable operation of the system in various cases. Also including if the socket connection is not stable

Screenshots

First stacktrace

0 libswiftCore.dylib _assertionFailure(_:_:file:line:flags:) + 264 1 libswift_Concurrency.dylib CheckedContinuation.resume(throwing:) + 476 2 WalletConnectSwiftV2 Dispatching.swift - Line 96 closure #1 in closure #1 in Dispatcher.protectedSend(_:) + 96 3 WalletConnectSwiftV2 Dispatching.swift - Line 83 closure #3 in Dispatcher.protectedSend(_:completion:) + 83 4 Combine Subscribers.Sink.receive(completion:) + 448 5 Combine protocol witness for Subscriber.receive(completion:) in conformance Subscribers.Sink<A, B> + 24 6 Combine Publishers.Timeout.Inner.timedOut() + 1000 7 libswiftDispatch.dylib thunk for @escaping @callee_guaranteed () -> () + 36 8 libdispatch.dylib _dispatch_client_callout + 20 9 libdispatch.dylib _dispatch_continuation_pop + 600 10 libdispatch.dylib _dispatch_source_latch_and_call + 420 11 libdispatch.dylib _dispatch_source_invoke + 832 12 libdispatch.dylib _dispatch_continuation_pop + 208 13 libdispatch.dylib _dispatch_async_redirect_invoke + 584 14 libdispatch.dylib _dispatch_root_queue_drain + 392 15 libdispatch.dylib _dispatch_worker_thread2 + 156 16 libsystem_pthread.dylib _pthread_wqthread + 228 17 libsystem_pthread.dylib start_wqthread + 8

Second stacktrace

libswiftCore.dylib _assertionFailure(_:_:file:line:flags:) + 264 1 libswift_Concurrency.dylib CheckedContinuation.resume(returning:) + 508 2 WalletConnectSwiftV2 Dispatching.swift - Line 100 closure #1 in closure #1 in Dispatcher.protectedSend(_:) + 100 3 WalletConnectSwiftV2 Dispatching.swift - Line 64 partial apply for closure #1 in Dispatcher.send(_:completion:) + 64 4 Tangem WebSocket.swift - Line 155 closure #3 in WebSocket.write(string:completion:) + 155 5 Foundation thunk for @escaping @callee_guaranteed @Sendable (@guaranteed Error?) -> () + 60 6 libdispatch.dylib _dispatch_call_block_and_release + 32 7 libdispatch.dylib _dispatch_client_callout + 20 8 libdispatch.dylib _dispatch_lane_serial_drain + 748 9 libdispatch.dylib _dispatch_lane_invoke + 432 10 libdispatch.dylib _dispatch_root_queue_drain_deferred_wlh + 288 11 libdispatch.dylib _dispatch_workloop_worker_thread + 404 12 libsystem_pthread.dylib _pthread_wqthread + 288 13 libsystem_pthread.dylib start_wqthread + 8

Device (please complete the following information):

  • Device: Any devices
  • OS: Any iOS version above 15.0

Additional context Add any other context about the problem here.

We see similar problems https://github.com/WalletConnect/WalletConnectSwiftV2/issues/1299 https://github.com/WalletConnect/WalletConnectSwiftV2/issues/1046

skibinalexander avatar Apr 26 '24 09:04 skibinalexander

hey @skibinalexander, thanks for reporting this, could you upgrade to 1.18.7 and share if you are still experiencing the issue please?

llbartekll avatar May 03 '24 10:05 llbartekll

Thank you for your attention to us. We understand, we will update and return with feedback. I don’t close it issue, for continue research.

skibinalexander avatar May 03 '24 12:05 skibinalexander

same crash on version 1.18.4

maltsevoff avatar May 03 '24 12:05 maltsevoff

@maltsevoff could you also try to upgrade?

llbartekll avatar May 03 '24 12:05 llbartekll

hey @skibinalexander do you still experience the crash?

llbartekll avatar Jun 06 '24 06:06 llbartekll

hey @skibinalexander do you still experience the crash?

Hello. Thank you for your interest, we are in the process of releasing the version you indicated and collecting statistics. I will definitely come back with feedback, so I'm not closing the issue.

skibinalexander avatar Jun 06 '24 07:06 skibinalexander

hey @skibinalexander, can I close the issue?

llbartekll avatar Jul 26 '24 01:07 llbartekll

hey @skibinalexander, can I close the issue?

Yes, thank you, we planned to close the issue for now, we are watching the statistics

skibinalexander avatar Jul 28 '24 23:07 skibinalexander