Code Monkey home page Code Monkey logo

kin-ios's People

Contributors

beeman avatar kikengineering avatar richardmands avatar samdowd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kin-ios's Issues

Crash when sending Kin

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

Crash_Kin1

Crash_Kin2

iOS-only bug: KinTransaction.transactionHash is incorrect in Kin4 (Solana) mode

seems to be an iOS-only SDK bug, this sequence works fine in Android.

short version:

  • Kin3: returns valid txn ID
  • Kin4: returns invalid txn ID

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

Crash when load transaction history

crash

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

BaseCompat account.status gives unknown error on 0.4.0 while code was working on production using old SDKs

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!

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

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.

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

kin balance does not update with KinBaseCompat

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:

  • 0.1.0
  • 0.1.1

Status API returns unknown error

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:

  1. Create or get local wallet if exists
  2. Check if wallet exists on the blockchain
  3. If no, create on the blockchain
  4. Do other stuff

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!

README improvement

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'

build: update build tools and dependencies to their latest versions

The dependencies in the repo need to be updated to the latest version:

  • Podfile(.lock) (main dependencies)
  • Gemfile(.lock) (used for slather)

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.

Cannot send transaction

I get the following error after installing the compat SDK:

Error send transaction
with error: retriesExceeded

"signature not found" - but payment goes through anyway

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
Payment goes through on blockchain.
✅ Agora event webhook is fired

tx: 4KQYYBTCGyoSspwrJess7KA9duMf3d8ZVXFuNFhSugjGSBwHu7kESRfwt4M5esq3qV5dm2iCMikWRf7uHnhGCeXe
Client error (signature not found)
Payment goes through on blockchain
Agora event webhook is NOT fired

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})

Issue Sending Whitelisted XDR (KinBaseCompat)

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:

https://github.com/kinecosystem/kin-sdk-ios/blob/93f718296f2a9bc7c1d8cdecaab6a9e6530d011a/KinSDKSampleApp/KinSDKSampleApp/SendTransactionViewController.swift#L52

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!

Crash: specialized KinTransaction.init(envelopeXdrBytes:record:network:invoiceList:historyItem:)

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

App crashes with error in XDRCodableExtensions.swift.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.