-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Store also first empty accounts after discovery #12521
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty accounts are visible in My Assets and Receive tabs.
In case we hide them there, make sure that Add account works. Because now add new account wont add anything, since there is an empty account for each asset.
How should it work if we add first empty account? Possibly discover the next one if under limit of 10?
b2c61f5
to
416db6e
Compare
One more thought. Does this also solve situation where user in Suite adds new account of network that was not previously discovered on Lite app and receives txn there? Or in that case he wont see it? |
It was really a memoization issue caused by usage of I'll also prepare update of proxy-memoize, but it has caused us a lot of problems before, so I'll prepare it in a special PR for testing. |
It should solve this case too, needs to be tested. |
85614d8
to
0790dbc
Compare
Back to draft, empty wallet is not handled yet. |
fixed in e99f18e |
const account = | ||
firstHiddenEmptyAccount || | ||
(await dispatch( | ||
addAndDiscoverNetworkAccountThunk({ | ||
network, | ||
deviceState: device.state, | ||
}), | ||
).unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary solution, I would expect removal of addAndDiscoverNetworkAccountThunk as part of #11562
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to discover another hidden empty account here even in case this one is made visible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, this probably does not make a sense unless the account is not empty.
But we can check regularly, that there exists at least one empty account of each coin-accountType pair and if not, run discovery until we find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is basically how it wokrks on desktop, but let's leave it please for another PR, this one is already bigger than expected 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job. I’ve tested it and everything works as expected. 👌
…uring discovery - By creating invisible empty discovered accounts, user can see it once he sent some TX there. - We don't repeat discovery on every Trezor connect yet and with view-only feature it can happen more often, that user will send some TX on new account and will never see it in Suite Lite until disable view-only and reconnect. - As opposed to Suite Desktop, in mobile there is a batched discovery so it can happen that there are 2 invisible empty accounts for some coins.
e99f18e
to
60a4364
Compare
Description
By creating invisible empty discovered accounts, user can see it once he sent some TX there.
We don't repeat discovery on every Trezor connect yet and with view-only feature it can happen more often, that user will send some TX on new account and will never see it in Suite Lite until disable view-only and reconnect.
As opposed to Suite Desktop, in mobile there is a batched discovery so it can happen that there are 2 invisible empty accounts for some coins.
This is not a final solution at all, just a small improvement as a first step – discovery resume/continue needs to be implemented #11562
Acceptance criteria (notes for QA)