Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple token accounts created for wallet, whilst not being able to transact from any other token account. #58

Open
cryptobarbossa opened this issue Aug 30, 2021 · 9 comments · May be fixed by #64
Assignees
Labels
bug Something isn't working urgent high priority

Comments

@cryptobarbossa
Copy link

cryptobarbossa commented Aug 30, 2021

Issue:
Multiple token accounts get created for a user's wallet. Take a look at this address:
5rcavJ8n9v67u9G7SPgK3MnynBYkR6cqnVPpu19vBpUy

I am only able to e.g. spend 1 Kin from the token account made available to me whilst the other token account is hidden with the balance of 999. So the 999 Kin becomes un-spendable.

Solution suggestion:
Allow the discovery of all token accounts and have a merge operation on those token accounts. This way it becomes easier for users to manage their wallets.

@mocolicious mocolicious self-assigned this Aug 30, 2021
@cryptobarbossa
Copy link
Author

@mocolicious how is it going so far?

@mocolicious
Copy link
Member

mocolicious commented Sep 6, 2021

@mocolicious how is it going so far?

I've been mostly without power and internet the past week due to hurricane Ida so I will dig into it more this week. If you have some code you can post that can replicate the issue that will help.

@mocolicious
Copy link
Member

relates to kin-android/issues/26. This issue occurs when a wallet outside of the Kin Ecosystem (Agora) sends kin to an SDK from within the ecosystem. The resolution in the existing SDKs was to add a merge account feature. We would prefer to squash the issue from occurring in the first place if that is at all possible. I will do some more digging to try and understand why this happens and if there's a fix that could be done either through Agora or to our SDK that can prevent it. Otherwise we will look to replicate the merge feature.

@mocolicious mocolicious added the bug Something isn't working label Sep 7, 2021
@cryptobarbossa
Copy link
Author

@mocolicious how is it going so far?

I've been mostly without power and internet the past week due to hurricane Ida so I will dig into it more this week. If you have some code you can post that can replicate the issue that will help.

@cryptobarbossa
Copy link
Author

Accidentally closed. Reopened now. @mocolicious Thanks for the update, we spoke yesterday also more about this issue, let me know how it goes.

@cryptobarbossa
Copy link
Author

Urgent label needs to be assigned.

Alternative and more immediate solution:
If multiple token accounts get created, allow users to pick which token account to spend from. Currently the SDK only detects one token account. This would create a workable environment for the wallet and users.

Further progression:
Adapt the merge function from the Android SDK.

@mocolicious mocolicious added the urgent high priority label Sep 14, 2021
@mocolicious
Copy link
Member

Urgent label needs to be assigned.

Alternative and more immediate solution:
If multiple token accounts get created, allow users to pick which token account to spend from. Currently the SDK only detects one token account. This would create a workable environment for the wallet and users.

Further progression:
Adapt the merge function from the Android SDK.

We will start work on the merge account, be aware that this isn't a complete solution. Peerbet says that this merge function can be as quick as a few minutes but may take up to 24 hours. I'd like to document the exact combination of configurations that will cause this issue so that we can see if anything can be done on the Agora side.

@cryptobarbossa
Copy link
Author

Urgent label needs to be assigned.
Alternative and more immediate solution:
If multiple token accounts get created, allow users to pick which token account to spend from. Currently the SDK only detects one token account. This would create a workable environment for the wallet and users.
Further progression:
Adapt the merge function from the Android SDK.

We will start work on the merge account, be aware that this isn't a complete solution. Peerbet says that this merge function can be as quick as a few minutes but may take up to 24 hours. I'd like to document the exact combination of configurations that will cause this issue so that we can see if anything can be done on the Agora side.

How is the progress on the merge?

@mocolicious
Copy link
Member

Urgent label needs to be assigned.
Alternative and more immediate solution:
If multiple token accounts get created, allow users to pick which token account to spend from. Currently the SDK only detects one token account. This would create a workable environment for the wallet and users.
Further progression:
Adapt the merge function from the Android SDK.

We will start work on the merge account, be aware that this isn't a complete solution. Peerbet says that this merge function can be as quick as a few minutes but may take up to 24 hours. I'd like to document the exact combination of configurations that will cause this issue so that we can see if anything can be done on the Agora side.

How is the progress on the merge?

We added the changes to support automerge setting on another branch but are still working on the issue you had identified and will create a separate issue for that. Fix will be applied prior to merge.

The issue is this error

Unhandled Exception: Bad state: Private key missing for account with id: Id(value={Address}, b58={Address}) > javaHashCode: -1987391069 ; hashCode: 533199540 E/flutter ( 9281): #0 KinAccountContextImpl._getAccountImpl (package:kin_base/base/kin_account_context.dart:551:7) E/flutter ( 9281): <asynchronous suspension> E/flutter ( 9281): #1 KinAccountContextImpl.getAccount (package:kin_base/base/kin_account_context.dart:538:19) E/flutter ( 9281): <asynchronous suspension> E/flutter ( 9281): #2 KinAccountContextBase.balanceSubject.<anonymous closure> (package:kin_base/base/kin_account_context.dart:175:23) E/flutter ( 9281): <asynchronous suspension>

@devayansarkar has also seen this issue when updating to the nullsafety version on the master and it seemingly resolved itself so we're working on recreating that issue so we can find the fix.

@mocolicious mocolicious linked a pull request Nov 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants