kinecosystem / kin-ios Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED! Please use Kinetic: https://developer.kin.org/docs/kinetic
Home Page: https://developer.kin.org/docs/kinetic
License: MIT License
DEPRECATED! Please use Kinetic: https://developer.kin.org/docs/kinetic
Home Page: https://developer.kin.org/docs/kinetic
License: MIT License
Some of my users encountered a crash when they sending kin. Please have a look at it
Version IOS: 14.7
Version Kin : 'KinBase', '2.0.0'
Version Xcode : 12.4
The function sending kin
let item = KinPaymentItem(amount: Kin(amount), destAccount: dest)
self?.kinAccountContext?.sendKinPayment(item, memo: KinMemo(text: ""))
.then(on: .main) { payment in
}
.catch(on: .main) { error in
}
Below are file logs the crash
If you don't have a configured mail client, you will get an error message and you cannot continue. Instead of requiring a mail client (which many people don't have) I think it is better to just open the share dialog. People can share via email there, or choose any other method they like to save that image.
seems to be an iOS-only SDK bug, this sequence works fine in Android.
short version:
details of our test in testnet
:
we've run a test, and logged the result from completion call-back after submitting a transaction:
Kin 3
KinTransaction(record=Record(recordType: KinBase.Record.RecordType.inFlight, timestamp: 1607478521.504432, resultXdrBytes: nil, pagingToken: nil)), network=testNet, envelopeXdrBytes=(...), invoiceList=nil, transactionHash=Optional(2e41cf6eda5d375d5561c61f5a1038d595677c7090800be2b76be23f29cee125), sourceAccount=GBMGGHO5JR7F5FDRHACQA6ZMOGEJZSPL6QPDERMUG3NBFRFTC5LZNJJI, sequenceNumber=42549863044349953, fee=100, memo=KinMemo(rawValue: [49, 45, 108, 115, 102, 102, 45], type: KinBase.KinMemo.MemoType.text), paymentOperations=[KinBase.KinPaymentOperation(amount: 1, source: "GBMGGHO5JR7F5FDRHACQA6ZMOGEJZSPL6QPDERMUG3NBFRFTC5LZNJJI", destination: "GBU6WDB2BKWO6IDAC3PJ6ZFZEMOKASXWXPYI4IFURACTH4WIBT5AM65H")], resultCode=nil"
--> received a valid transactionId: 2e41cf6eda5d375d5561c61f5a1038d595677c7090800be2b76be23f29cee125
Kin 4
KinTransaction(record=Record(recordType: KinBase.Record.RecordType.inFlight, timestamp: 1607478707.911574, resultXdrBytes: nil, pagingToken: nil)), network=testNet, envelopeXdrBytes=(...), invoiceList=nil, transactionHash=Optional(00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000), sourceAccount=GBMGGHO5JR7F5FDRHACQA6ZMOGEJZSPL6QPDERMUG3NBFRFTC5LZNJJI, sequenceNumber=0, fee=0, memo=KinMemo(rawValue: [49, 45, 108, 115, 102, 102, 45], type: KinBase.KinMemo.MemoType.text), paymentOperations=[KinBase.KinPaymentOperation(amount: 1, source: "GBMGGHO5JR7F5FDRHACQA6ZMOGEJZSPL6QPDERMUG3NBFRFTC5LZNJJI", destination: "GCUGWE7V7IK4XFNBEZ3KYNPMB3MKHLWZPVG436ZSFDL6RMP62MJMJI5Y")], resultCode=nil"
--> received an invalid transactionId
Hi support Team,
We are on the latest version(0.4.5). We have encountered the crash when we load kin transaction history
Step 1: We create a transaction with a unique memo added
Step 2: We �try to read transaction history and crashes
Step 3: Even after re-opening the app which crashes, any attempt to read transaction history crashes the app again
Hello! I'm working on integrating the Agora SDK for KinFit, which is already running on kin for quite some time. I updated the kin-ios version in the podfile to 0.4.0, rebuilt and now the account.status
function does not work anymore.
Here is the relevant part of the code (I added some asdasd so I can more easily find it in the logs):
...
print("asdasdQ")
print(self.account)
self.account!.status { (status: AccountStatus?, error: Error?) in
print("asdasdX")
print(status)
print(error)
guard let status = status else { return }
...
Here are the logs:
asdasdQ
Optional(KinSDK.KinAccount)
2020-11-21 10:15:45.440887+0100 kinfit[66572:7024944] KinBase.KinAccountContext::info::getAccount(forceUpdate:)
2020-11-21 10:15:45.443145+0100 kinfit[66572:7024944] KinBase.KinService::debug::[Request][V3]====
CreateAccountRequest(accountId: "GAA7C3Z2ATHIFIVS2PNKT2ZJLDKP3TOPF5GZKO3QTTZZO2U35NIK3QHY")
=====[Request][V3]
2020-11-21 10:15:45.443657+0100 kinfit[66572:7024896] KinBase.AgoraGrpcProxy::debug::AgoraGrpcProxy::request::<APBAccountV3CreateAccountRequest 0x600002e081e0>: {
account_id {
value: "GAA7C3Z2ATHIFIVS2PNKT2ZJLDKP3TOPF5GZKO3QTTZZO2U35NIK3QHY"
}
}
2020-11-21 10:15:45.997364+0100 kinfit[66572:7024944] KinBase.AgoraGrpcProxy::debug::AgoraGrpcProxy::response::<APBAccountV3CreateAccountResponse 0x600002e7ab80>: {
result: EXISTS
account_info {
account_id {
value: "GAA7C3Z2ATHIFIVS2PNKT2ZJLDKP3TOPF5GZKO3QTTZZO2U35NIK3QHY"
}
sequence_number: 40682033306927104
}
}
2020-11-21 10:15:45.998102+0100 kinfit[66572:7024944] KinBase.KinService::debug::[Response][V3]====
CreateAccountResponse(result: KinBase.CreateAccountResponse.Result.exists, error: nil, account: nil)
=====[Response][V3]
asdasdX
nil
Optional(KinBase.KinService.Errors.unknown)
So as you see, everything is working nicely (Agora tells the account already exists), but when I do account.status
I receive an Optional(KinBase.KinService.Errors.unknown)
Any ideas?
Thanks!
We should make sure that the Podspec is always properly linted before merging in new changes.
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.
We suspect this is a (de)serialization issue, where the structure of the data coming in isn’t what kin-ios is expecting.
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
details filed in this issue for the old SDK:
tl;dr
would be great to add this into the new SDKs
after integrating the new kin-ios sdk (‘KinBaseCompat’, ‘~ > 0.1.0’), the real-time call-back when kin balance change is not working now.
The function get balance was still working normally with the old ios SDK:
private func watchBalance(completion : @escaping ((Kin)- > Void)) {
if let account = self.getFirstAccount() {
self.watch = try? account.watchBalance(nil)
self.watch?.emitter.on(queue: .main, next: { [weak self] balance in
self?.currentKin = balance
completion(balance)
})
.add(to: self.linkBag)
}
}
func getFirstAccount() - > KinAccount? {
if let kinClient = kinClient {
return kinClient.accounts.first
}
return nil
}
issue confirmed in:
I'm switching from the old to the new SDK and am encountering an issue.
I'm calling this:
print(self.account!)
print(self.account!.publicAddress)
// If not registered on the blockchain, do that
self.account!.status { (status: AccountStatus?, error: Error?) in
print(status)
print(error)
Which prints this:
KinSDK.KinAccount
GDYBEP2VI5FR3Y2HQ2WEJFPZE33LACIUJFTBUB3UQCMU7LJA3MDMSKMN
nil
Optional(KinBase.KinService.Errors.unknown)
My flow is like this:
For step 3, I call the function above. On the old SDK this gives me either created
or not_created
as status, while in the new SDK the status is nil
and I get an unknown error. Any idea what could be going on?
Thanks!
For the compat case, you also need to remove the BackupRestore subspec. It still works without it, might want to add this :) great work!
So I had to update:
pod 'KinSDK', '~> 1.0.2', :subspecs => ['BackupRestore']
To
pod 'KinBaseCompat', '~> 0.1.0'
The dependencies in the repo need to be updated to the latest version:
Once these are updated and result to a green build on CI we can push a minor release (1.1.0) that ships these new dep versions.
I get the following error after installing the compat SDK:
Error send transaction
with error: retriesExceeded
We're getting an intermittent issue on iOS whereby we are receiving a client error ("grpc_message":"unhandled error from SubmitTransaction: signature not found","grpc_status":13)
, but the transaction actually does go through anyway.
Further to this (and really important to us) is that the Event Webhook does not get called in this case.
tx: 28DYsuJ3zyds4MUVAnguUneKKmjZgRAr9pFS5S2QrWoCYPo1S7Xh1L353AHdbryxADhD7aebXN64GTzYm8u8A5e2
✅ Client success
✅ Agora event webhook is fired
tx: 4KQYYBTCGyoSspwrJess7KA9duMf3d8ZVXFuNFhSugjGSBwHu7kESRfwt4M5esq3qV5dm2iCMikWRf7uHnhGCeXe
Full iOS SDK error:
transientFailure(error: Error Domain=io.grpc Code=13 "{"created":"@1619040502.719064000","description":"Error received from peer ipv4:54.237.169.129:443","file":"ios/Pods/gRPC-Core/src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"unhandled error from SubmitTransaction: signature not found","grpc_status":13}" UserInfo={io.grpc.HeadersKey={
}, io.grpc.TrailersKey={
}, NSDebugDescription={"created":"@1619040502.719064000","description":"Error received from peer ipv4:54.237.169.129:443","file":"ios/Pods/gRPC-Core/src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"unhandled error from SubmitTransaction: signature not found","grpc_status":13}, NSLocalizedDescription=unhandled error from SubmitTransaction: signature not found})
this case is 100% reproducible.
the workaround for our users have been to delete/re-install our app, then restore their wallet. After which, users are able to p2p tip other users without a crash in the kin-ios SDK code.
We suspect this is something wrong with how kin_storage/kin_accounts is being handled.
KinUtil
has been removed in the latest SDK, which means the XDRDecoder.decode()
method is no longer available.
This was the one of the steps in the recommended way of Whitelisting a transaction, as shown in the Sample App here:
The XDR returned from the app's server needs to be decoded before being sent (kinAccount.sendTransaction()
). In Android there is a method kinAccount.sendWhitelistTransaction()
but iOS doesn't have the same.
For the sake of backward compatibility, please could you re-introduce KinUtil
? I know it's not blockchain-agnostic, but it would only need to be in KinBaseCompat
Thanks!
worked in 0.3.x BaseCompat, but seems to be broken in the 0.4.x series
Hi,
We are using IOS version 2.0.0. Everything is fine until yesterday, we saw this crash for 50% of our accounts. This crash will be gone if we restart the device. Have you guys faced this issue? We are planning to upgrade to version 2.1.1, however, it requests us to upgrade the firebase version as well. If you guys know how to fix this, please let us know.
Crashed: KinBase.KinFileStorage
EXC_BREAKPOINT 0x00000001026fff8c
0
KinBase
KinTransaction.swift - Line 413932
specialized KinTransaction.init(envelopeXdrBytes:record:network:invoiceList:historyItem:) + 413932
1
KinBase
KinTransaction.swift - Line 99
specialized KinTransaction.init(envelopeXdrBytes:record:network:invoiceList:historyItem:) + 99
2
KinBase
- Line 391508
KinStorageKinTransactions.kinTransactions(network:) + 391508
3
KinBase
KinFileStorage.swift - Line 509
closure #1 in KinFileStorage.readTransactions(account:) + 509
4
KinBase
- Line 283332
partial apply for closure #1 in KinFileStorage.readTransactions(account:) + 283332
5
KinBase
partial apply for thunk for @escaping @callee_guaranteed (@guaranteed @escaping @callee_guaranteed () -> (), @guaranteed @escaping @callee_guaranteed (@guaranteed Error) -> ()) -> (@error @owned Error) + 284644
6
KinBase
partial apply for thunk for @escaping @callee_guaranteed (@guaranteed @escaping @callee_guaranteed (@guaranteed KinTransactions?) -> (), @guaranteed @escaping @callee_guaranteed (@guaranteed Error) -> ()) -> (@error @owned Error) + 283368
Hi Team,
Our app works fine in the simulator but crashes when we attempt a transaction operation. We are on the latest version and the crash log suggests it is crashing during a process in XDRCodableExtensions.swift.
I am attaching the crash logs. Have you heard of similar issues from other teams ?
Best regards,
Dev
testflight_feedback.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.