[Bugfix] Fix back button trap in seed backup verification review#909
[Bugfix] Fix back button trap in seed backup verification review#909none34829 wants to merge 3 commits into
Conversation
|
Tested this locally and the fix works as intended. After selecting the wrong word and then choosing "Review seed words", pressing BACK no longer returns to the "Wrong Word!" screen. It takes you back into the verification flow, which matches the earlier discussion around this issue. So this appears to fix the actual back-button loop without turning review into an escape hatch out of verification. Also, just to be clear, this does not look like the same problem as the earlier NACK in #855. That PR was NACKed because it changed the flow in a way that let users back out of verification entirely. This change looks narrower and seems to address the specific loop Keith called out without weakening the verification flow. One thing still missing is test coverage for the BIP-85 child seed flow. Since #854 calls out both normal seed backup verification and BIP-85 child seed backup verification, can you add the test for the BIP-85 path as well? |
There was a problem hiding this comment.
I'm currently NACK on this PR, but Concept ACK.
PR #855 attempted to address the same issue and was closed. The discussion there is meaningful, and I agree with most of the points raised in that thread.
I do think the current flow is intentional, as Alvaro noted here: #855 (comment)
At the same time, I agree that sending BACK to the error screen is confusing, and the proposed change to skip that view does keep the user in verification context. However, this does not actually result in a fresh verification attempt, despite the PR description saying that it does.
From hands-on testing and viewing the back_stack in logs, after hitting a mistake and selecting Review seed words, pressing BACK returns to verification with prior state still preserved. The flow returns to SeedWordsBackupTestView with confirmed_list already populated, instead of resetting the attempt.
Concrete example:
- Suppose user correctly verifies words 1, 9, and 4.
- Then user gets word #5 wrong.
- On the Wrong Word screen, they choose Review seed words.
- After reviewing and pressing BACK, they return to
SeedWordsBackupTestViewcarryingconfirmed_listwith previously validated indexes ([0,8,3]), which is not a fresh run.
That can be even more confusing, because the verification resumes as if earlier answers are still trusted after the user intentionally stepped out to review. That is, the words that were in the said list will not be re-verified, after the user potentially corrected their backup or created a new one.
My preference:
- BACK from seed word review should return to verification flow, as this PR does.
- But on this review-back path, verification state should be reset so attempt restarts from the beginning.
|
Good catches, both of you. @Chaitanya-Keyal — you're right. With I've pushed a follow-up: instead of navigating to The trade-off is the user doesn't jump straight into the word pages anymore — they go through the prompt first. But it means no stale state and a clear exit path, which I think is the right call. @PROWLERx15 — added a BIP-85 flow test covering the same review-back path for child seed verification. |
|
Pushed a follow-up- "Review seed words" now routes through SeedWordsWarningView so the back stack is clean and confirmed_list resets. Added a BIP-85 child seed test too @Chaitanya-Keyal @PROWLERx15 |
|
Just a small note, I know you're eager to contribute, which is great to see. But I think you might have missed something Keith mentioned during the Summer of Bitcoin onboarding call. You can take a look at this gist for the summary of the call: https://gist.github.com/Chaitanya-Keyal/69225236ec8404a595742daa3c8522c1 Thank you for making the changes. I'll review them when possible :) |
|
Noted- will avoid the tags going forward. Thanks for the heads-up. |
There was a problem hiding this comment.
Retested on latest PR updates: still NACK from my side.
Routing through SeedWordsWarningView removes the direct Wrong Word -> Review -> Wrong Word loop, but it does not fix the underlying UX issue. It adds an extra warning hop, and BACK still returns into stale verification context instead of a clean restart. I can reproduce this both when proceeding through the warning and when skipping it (BACK on the first seed-words page still goes back into stale verification flow).
So this reshapes the loop rather than resolving it. I still think the review-back path should produce a clean, unambiguous verification restart without extra warning hops.
Reading the thread in #855, Keith mentioned a couple of possible fixes, maybe you could try looking into those. IMO, it might be messy, I'm not sure, but the most ideal fix would be to manipulate the back_stack and clear out that confirmed_list.
Also, I'm normally completely okay with being tagged on PRs like this. But it is kinda frustrating when, after calling for a re-review, behavior claimed as "fixed/tested" in comments does not match hands-on results. I'd strongly recommend checking stdout logs and the back_stack state while testing this full flow.
|
Fair point on the stale Instead of routing through The flow is now: Verified in the |
Description
Problem or Issue being addressed
Fixes #854.
During seed backup verification, if you pick the wrong word you get a "Wrong Word!" screen with two options: "Review seed words" and "Try again." If you choose "Review seed words," it shows the seed words with a back button. Pressing back returns you to the "Wrong Word!" screen, creating an infinite loop:
Wrong Word → Review seed words → Seed words display → Back → Wrong Word → (repeat)
The only escape is remembering the correct word and using "Try again."
Solution
Added
skip_current_view=Trueto theDestinationreturned when the user selects "Review seed words" inSeedWordsBackupTestMistakeView. This prevents the mistake view from being pushed onto the back stack, so pressing BACK from the word review returns to a fresh verification attempt instead of looping back to the error screen.One-line fix in
seed_views.py. Same pattern used bySeedWordsWarningView(line 1019) to prevent going BACK to warning screens.Additional Information
Includes a FlowTest (
test_review_words_after_wrong_answer_no_back_trap) that:rand_seed=3, cur_index=2)SeedWordsBackupTestView(fresh verification), NOTSeedWordsBackupTestMistakeView(the loop)Verified the test fails without the fix (lands on MistakeView) and passes with it.
This pull request is categorized as a:
Checklist
I ran
pytestlocallyI included screenshots of any new or modified screens
Should be part of the PR description above.
I added or updated tests
Any new or altered functionality should be covered in a unit test. Any new or updated sequences require FlowTests.
I tested this PR hands-on on the following platform(s):
I have reviewed these notes:
Thank you! Please join our Devs' Telegram group to get more involved.