fix: add account v2 redirection from receive when no account found / add account v1 is OK #8999
+162
−63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✅ Checklist
npx changeset
was attached.📝 Description
Issue analysis:
After reviewing the scenario in detail, it appears the account selection screen displayed in this particular use case is the "add account v1" version (designed for receiving), even the screen preceding the scan is the "add account v1" (intended for receiving). Therefore, when you select an account from the list, it will be added.
Essentially, on the production environment, this isn't a bug, because it's a logical sequence:
I initiate a "receive" operation.
I select an asset for which I don't have an existing account.
The scan that launches is the "add account v1" version.
The displayed list is the "add account v1" list for receiving (since it's a single selection).
Normally, if the "add account v2" feature flag is activated, we should go through (in this specific case) the "add account v2" device scan -> then a success or warning screen -> when we choose an account -> redirection to the address/QR code page. This case should be part of the receive plugin, however, I only handled the case where the "add account" button is on the account selection screen in cases of accounts already existing on the receive.
Solution:
When the user try to receive funds on currency where there is no persisted account, the redirection should be done to Add account v2 flow (FF ON) and on the success/warning page when an account is selected , the redirection should be to the receive confirmation page with QR code.
Full scenario here ⬇️
Screen.Recording.2025-01-24.at.15.38.26.mov
I also made a refactor for the use of string literal
"addAccounts"
or"receiveFunds"
across the codebase and replaced it with common enum based type.Please make sure your review covers the scope of the changes.
❓ Context
https://ledgerhq.atlassian.net/browse/LIVE-16522
🧐 Checklist for the PR Reviewers