WalletConnect / WalletConnectSwiftV2

WalletConnect Swift SDK v2
https://docs.walletconnect.com
Apache License 2.0
368 stars 180 forks source link

Click "View All" will crash #1355

Closed ngn999 closed 3 months ago

ngn999 commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

SDK Version

To Reproduce Steps to reproduce the behavior:

  1. Click "View All" to view all wallet
  2. crash

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

Additional context OS Version: iOS 17.0.3 (21A360) Report Version: 104

Exception Type: EXC_BREAKPOINT (SIGTRAP) Crashed Thread: 0

Application Specific Information: Exception 6, Code 1, Subcode 4401515968 > Stack overflow in (null)

Thread 0 Crashed: 0 WalletConnectSwiftV2 0x10659cdc0 [inlined] value 1 WalletConnectSwiftV2 0x10659cdc0 WalletList.gridItem (WalletList.swift:172) 2 WalletConnectSwiftV2 0x106599f38 [inlined] $s7SwiftUI6VStackV9alignment7spacing7contentACyxGAA19HorizontalAlignmentV_12CoreGraphics7CGFloatVSgxyXEtcfCAA9TupleViewVyAA15ModifiedContentVyAQyAQy013WalletConnectA2V20P5ImageVAA12_FrameLayoutVGAA11_ClipEffectVyAA16RoundedRectangleVGGAA16_OverlayModifi... 3 WalletConnectSwiftV2 0x106599f38 WalletList.gridItem (WalletList.swift:163) 4 WalletConnectSwiftV2 0x10659b0b0 WalletList.viewAll (WalletList.swift:91) 5 SwiftUI 0x31d36a460 OUTLINED_FUNCTION_21 6 SwiftUI 0x31d374d24 OUTLINED_FUNCTION_21 7 SwiftUI 0x31cc0afac OUTLINED_FUNCTION_52 8 SwiftUI 0x31d374d44 OUTLINED_FUNCTION_21 9 libswiftCore.dylib 0x3070be0f8 withUnsafeMutablePointer 10 SwiftUI 0x31d369850 OUTLINED_FUNCTION_21 11 SwiftUI 0x31d36c160 OUTLINED_FUNCTION_21 12 SwiftUI 0x31d36dac0 OUTLINED_FUNCTION_21 13 SwiftUI 0x31d372274 OUTLINED_FUNCTION_21 14 SwiftUI 0x31d3726b0 OUTLINED_FUNCTION_21 15 SwiftUI 0x31dc00808 OUTLINED_FUNCTION_4 16 SwiftUI 0x31dbff064 OUTLINED_FUNCTION_4 17 SwiftUI 0x31c42ffc0 OUTLINED_FUNCTION_37 18 SwiftUI 0x31c42ed8c OUTLINED_FUNCTION_37 19 SwiftUI 0x31c6a5c48 _swift_stdlib_malloc_size 20 AttributeGraph 0x363ed5850 AG::Graph::UpdateStack::update 21 AttributeGraph 0x363ecc500 AG::Graph::update_attribute 22 AttributeGraph 0x363ecbdd8 AG::Graph::input_value_ref_slow 23 AttributeGraph 0x363ecb96c AGGraphGetValue

ngn999 commented 5 months ago

The wallet with empty wallet name is this one: https://explorer.walletconnect.com/secux And the exactly line is: https://github.com/WalletConnect/WalletConnectSwiftV2/blob/c2802116f6e21df8d4fe587e289309776e8b015c/Sources/WalletConnectModal/Modal/Screens/WalletList.swift#L218

bkrem commented 5 months ago

Thanks for your report @ngn999 🙏 The missing name field issue on the API should be resolved, which should hopefully avoid this crash from being triggered.

The Swift SDK fix to make behaviour more tolerant and avoid crashing unnecessarily here will still need to be addressed separately.