kin-ios icon indicating copy to clipboard operation
kin-ios copied to clipboard

Crash: Missing transactions or expected fields on blockchain causes kin-ios to crash

Open rorymc opened this issue 2 years ago • 0 comments

looks like Kin SDK is querying txns, and hitting a deserialization error, which then causes a hard crash.

This started happening to the wallet below on Saturday, and he hasn't been able to use our app since.

https://explorer.solana.com/address/HLLN2GQwBHhHaag8sT7gdRYpQRz65uyByCYyiozhXYTu/tokens?display=detail&cluster=mainnet

We suspect this is a (de)serialization issue, where the structure of the data coming in isn’t what kin-ios is expecting.

  • Some of those transactions for that wallet aren’t available (see https://explorer.solana.com/tx/4Y2JT2B7XHc8j9gY6zVkoCfeLRRwCTvuoJmVK7FUumpaohBWeG1Lg6DAyjyKW7vPcbZVoWDhRCrAJCi4MTUxcfie?cluster=mainnet)
  • and some don’t have timestamps (https://explorer.solana.com/tx/8zmk3qwU2EjYYuTtoULRR3zuZ49Van1JjExahastkGRbkYQVRReM7DT78k8kXBiqzJmDTEwJowzUv7nuDXLpKhg?cluster=mainnet)

missing attributes from the server or unexpected server response may be the root issue.

This is the stacktrace from Crashlytics:

Crashed: KinBase.KinFileStorage 0 KinBase 0x81d34 specialized Message.init(data:) + 441676 (Data+Slice.swift:441676) 1 KinBase 0xa39a0 specialized Transaction.init(data:) + 580024 (:580024) 2 KinBase 0x7bb1c specialized KinTransaction.init(envelopeXdrBytes:record:network:invoiceList:historyItem:) + 110 (KinTransaction.swift:110) 3 KinBase 0x766b0 KinStorageKinTransactions.kinTransactions(network:) + 191 (KinStorableObjectExtensions.swift:191) 4 KinBase 0x5819c closure #1 in KinFileStorage.readTransactions(account:) + 509 (KinFileStorage.swift:509) 5 KinBase 0x59da4 partial apply for closure #1 in KinFileStorage.readTransactions(account:) + 277948 (:277948) 6 KinBase 0x5a2c4 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed @escaping @callee_guaranteed () -> (), @guaranteed @escaping @callee_guaranteed (@guaranteed Error) -> ()) -> (@error @owned Error) + 279260 7 KinBase 0x59dc8 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed @escaping @callee_guaranteed (@guaranteed KinTransactions?) -> (), @guaranteed @escaping @calleeguaranteed (@guaranteed Error) -> ()) -> (@error @owned Error) + 277984 8 Promises 0xce1c closure #1 in Promise.init(on::) + 27 (Promise+Async.swift:27) 9 Promises 0xf8a8 thunk for @escaping @callee_guaranteed (@guaranteed @escaping @callee_guaranteed (@guaranteed Swift.AnyObject?) -> (), @guaranteed @escaping @callee_guaranteed (@guaranteed Error) -> ()) -> () + 4431722664 (:4431722664) 10 FBLPromises 0x8d7c __44+[FBLPromise(AsyncAdditions) onQueue:async:]_block_invoke + 50 (FBLPromise+Async.m:50) 11 libdispatch.dylib 0x1e68 _dispatch_call_block_and_release + 32 12 libdispatch.dylib 0x3a2c _dispatch_client_callout + 20 13 libdispatch.dylib 0xb204 _dispatch_lane_serial_drain + 892 14 libdispatch.dylib 0xbc80 _dispatch_lane_invoke + 392 15 libdispatch.dylib 0x16500 _dispatch_workloop_worker_thread + 648 16 libsystem_pthread.dylib 0x10bc _pthread_wqthread + 288 17 libsystem_pthread.dylib 0xe5c start_wqthread + 8

rorymc avatar May 16 '22 17:05 rorymc