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

[#21578] Keycard - Factory reset a Keycard #21914

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

flexsurfer
Copy link
Member

@flexsurfer flexsurfer commented Jan 10, 2025

fixes #21578

image

@status-im-auto
Copy link
Member

status-im-auto commented Jan 10, 2025

Jenkins Builds

Click to see older builds (16)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 150aa98 #1 2025-01-10 11:26:01 ~5 min tests 📄log
✔️ 150aa98 #1 2025-01-10 11:28:09 ~7 min ios 📱ipa 📲
✔️ 150aa98 #1 2025-01-10 11:28:14 ~7 min android-e2e 🤖apk 📲
✔️ 150aa98 #1 2025-01-10 11:30:12 ~9 min android 🤖apk 📲
✔️ 9ef178b #2 2025-01-14 07:52:34 ~4 min tests 📄log
✔️ 9ef178b #2 2025-01-14 07:54:50 ~7 min ios 📱ipa 📲
✔️ 9ef178b #2 2025-01-14 07:56:38 ~9 min android-e2e 🤖apk 📲
✔️ 9ef178b #2 2025-01-14 07:57:11 ~9 min android 🤖apk 📲
✔️ e24261c #3 2025-01-16 12:24:47 ~4 min tests 📄log
✔️ e24261c #3 2025-01-16 12:28:55 ~9 min android-e2e 🤖apk 📲
✔️ e24261c #3 2025-01-16 12:29:35 ~9 min android 🤖apk 📲
✔️ e24261c #3 2025-01-16 12:31:29 ~11 min ios 📱ipa 📲
✔️ 1b6bf2e #5 2025-01-17 09:05:07 ~4 min tests 📄log
✔️ 1b6bf2e #5 2025-01-17 09:09:02 ~8 min android-e2e 🤖apk 📲
✔️ 1b6bf2e #5 2025-01-17 09:09:35 ~9 min android 🤖apk 📲
✔️ 1b6bf2e #5 2025-01-17 09:10:54 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 787916c #6 2025-01-17 13:30:54 ~4 min tests 📄log
✔️ 787916c #6 2025-01-17 13:33:41 ~7 min android 🤖apk 📲
✔️ 787916c #6 2025-01-17 13:34:31 ~8 min android-e2e 🤖apk 📲
✔️ 787916c #6 2025-01-17 13:36:18 ~10 min ios 📱ipa 📲
5ba2af9 #7 2025-01-20 09:58:33 ~1 min ios 📄log
✔️ 5ba2af9 #7 2025-01-20 10:02:05 ~4 min tests 📄log
✔️ 5ba2af9 #7 2025-01-20 10:05:04 ~7 min android-e2e 🤖apk 📲
✔️ 5ba2af9 #7 2025-01-20 10:06:11 ~9 min android 🤖apk 📲
✔️ 5ba2af9 #8 2025-01-20 11:09:50 ~10 min ios 📱ipa 📲

Copy link
Member

@Parveshdhull Parveshdhull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @flexsurfer for the PR. Looks good to me.

src/status_im/contexts/keycard/create/events.cljs Outdated Show resolved Hide resolved
src/status_im/navigation/screens.cljs Show resolved Hide resolved
@status-im-auto
Copy link
Member

88% of end-end tests have passed

Total executed tests: 8
Failed tests: 1
Expected to fail tests: 0
Passed tests: 7
IDs of failed tests: 727230 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 1: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]`
    Device 1: `Text` is `0.315528 ETH`

    critical/test_wallet.py:200: in test_wallet_send_asset_from_drawer
        self.errors.verify_no_errors()
    base_test_case.py:176: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Eth amount in the shdUaM8M6QcxQ4qn32nQ's wallet is 0.3155 but should be 0.3154
    



    Passed tests (7)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490

    Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    @flexsurfer flexsurfer force-pushed the feature/Keycard-Factory-reset-a-Keycard-#21578 branch from 150aa98 to 9ef178b Compare January 14, 2025 07:47
    @pavloburykh pavloburykh self-assigned this Jan 14, 2025
    @ilmotta ilmotta self-requested a review January 15, 2025 00:43
    ilmotta

    This comment was marked as resolved.

    @flexsurfer
    Copy link
    Member Author

    flexsurfer commented Jan 15, 2025

    hey @pavloburykh lets pause this PR for now, i'll be back soon with updates, thank you

    @flexsurfer
    Copy link
    Member Author

    flexsurfer commented Jan 15, 2025

    thank you @ilmotta all point are valid, I rushed this pull request little bit, it needs more work, also about description you are right i'll change it

    @pavloburykh

    This comment was marked as resolved.

    @flexsurfer
    Copy link
    Member Author

    flexsurfer commented Jan 15, 2025

    i've implemented only Factory reset Keycard with other / unknown key pair flow in this PR, so i need to implement both in this PR, will be back soon with the update, and will update a description, thank you for your patience

    @flexsurfer
    Copy link
    Member Author

    Issue 1. User is locked out after successful reset

    After successfully resetting a keycard, the user is still asked to login with the keycard after logout, which prevents the user from logging in because the card was effectively reset.

    this is by design, cc @xAlisher

    @flexsurfer
    Copy link
    Member Author

    flexsurfer commented Jan 15, 2025

    Issue 3. Screen "Failed to reset Keycard" not implemented as in Figma

    Failed to reset keycard screen doesn't show tips at the bottom.

    @xAlisher can we change this in design? it will simplify development, for user there will be no difference, on try again we just move it to screen there he have all the instructions and can try again

    @flexsurfer
    Copy link
    Member Author

    Issue 5. Bottom sheet to factory reset is different from Figma

    Figma: https://www.figma.com/design/YGm3igIOAcwMqUVJWCJ6f1/Keycard?node-id=3039-58204&m=dev

    Differences:

    • Missing card name
    • Different paragraph text and checkbox text. Which one is right? Maybe Figma is outdated? Which Figma node did you base the implementation on?

    it's because i implemented different flow, i don't check if keycard is for current profile, i'll add this condition

    @flexsurfer
    Copy link
    Member Author

    flexsurfer commented Jan 15, 2025

    • Issue 1. User is locked out after successful reset
      by design, discuss with @xAlisher
    • Issue 2. Successful reset button shouldn't be "Done"
      implement profile flow or change design
    • Issue 3. Screen "Failed to reset Keycard" not implemented as in Figma
      change design
    • Issue 4. Biometrics are still active after profile migration to keycard
      not related to this PR
    • Issue 5. Bottom sheet to factory reset is different from Figma
      by design, this flow is from scan keycard, so it can be any card we don't check if it's profile keycard
    • ISSUE 6 'It's a different keycard` flow and screen is not implemented
      bug

    @flexsurfer
    Copy link
    Member Author

    Successful reset button shouldn't be "Done" this seems should also be fixed in design, there is no sense to logout user cc @xAlisher

    @flexsurfer
    Copy link
    Member Author

    @pavloburykh i checked , card is NOT reseted, not empty error screen is shown, so there is nothing to fix it seems, ready for testing

    @status-im-auto
    Copy link
    Member

    100% of end-end tests have passed

    Total executed tests: 8
    Failed tests: 0
    Expected to fail tests: 0
    Passed tests: 8
    

    Passed tests (8)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    @pavloburykh i checked , card is NOT reseted, not empty error screen is shown, so there is nothing to fix it seems, ready for testing

    @flexsurfer my bad. I have rechecked and see that it is not reset indeed.

    @flexsurfer flexsurfer force-pushed the feature/Keycard-Factory-reset-a-Keycard-#21578 branch from 9ef178b to e24261c Compare January 16, 2025 12:19
    @flexsurfer
    Copy link
    Member Author

    @pavloburykh added 'It's a different keycard` screen

    @flexsurfer
    Copy link
    Member Author

    hey @pavloburykh , after discussing with @xAlisher Facatory reset Keycard with Profile key pair flow was removed, PR is ready for review

    @pavloburykh
    Copy link
    Contributor

    hey @pavloburykh , after discussing with @xAlisher Facatory reset Keycard with Profile key pair flow was removed, PR is ready for review

    Thank you @flexsurfer! Got a question: according to the new design, after successful keycard reset user is redirected to the Keycard home screen with no Keycard linked https://www.figma.com/design/YGm3igIOAcwMqUVJWCJ6f1/Keycard?node-id=5595-70886&t=hAbB2p3cLP39ZmIX-0
    Keycard – Figma 2025-01-17 11-05-17

    But what if I have reseted the keycard with another profile on it and I still have another keycard linked to current profile? Shouldn't we redirect to the Keycard screen showing this linked keycard? This screen has been removed for some reason.

    @flexsurfer
    Copy link
    Member Author

    hey @pavloburykh sorry for confusion, @xAlisher is working on this and this is a separate issue not related to this PR

    @status-im-auto
    Copy link
    Member

    88% of end-end tests have passed

    Total executed tests: 8
    Failed tests: 1
    Expected to fail tests: 0
    Passed tests: 7
    
    IDs of failed tests: 702843 
    

    Failed tests (1)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 1: Wait for text element `EmojisNumber` to be equal to `1`
    Device 1: Find `EmojisNumber` by `xpath`: `//*[starts-with(@text,'Message AFTER edit 2 (Edited)')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-2']/android.widget.TextView[2]`

    critical/chats/test_public_chat_browsing.py:380: in test_community_message_edit
        self.errors.verify_no_errors()
    base_test_case.py:176: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message reaction is not shown for the sender
    



    Device sessions

    Passed tests (7)

    Click to expand

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490

    @pavloburykh
    Copy link
    Contributor

    pavloburykh commented Jan 17, 2025

    Thanks @flexsurfer couple of questions and issues:

    Issue 3. Screen "Failed to reset Keycard" not implemented as in Figma
    change design

    What does change design mean? Issue is still valid. Current implementation misses text which is present in Figma.

    @pavloburykh
    Copy link
    Contributor

    ISSUE 7 Scanning not a keycard redirects to Failed to reset keycard instead of 'This is not a keycard` screen

    Steps:

    1. Login profile which is migrated to keycard
    2. Go to Profile - Keycard - Ready to scan
    3. Scan keycard
    4. During second scan use not a keycard
    5. Observe the result

    Actual result: user is redirected to Failed to reset keycard

    photo_2025-01-17 17 16 43

    Expected result: user is redirected to 'This is not a keycard`

    Keycard – Figma 2025-01-17 17-17-04

    @pavloburykh
    Copy link
    Contributor

    ISSUE 8 Scanning different key card (which is not empty) during Create Profile flow results in stuck on Preparing screen or overwriting keys on this keycard

    Steps:

    1. Start Creating Profile by scanning Keycard A
    2. During second (final) scan use Keycard B which is not empty
    3. Observe the result

    Actual result:

    1. Sometimes user stucks on Preparing screen
    2. Sometimes profile is created successfully and Keycard B keys are overwritten

    photo_2025-01-17 17 35 37

    Expected result: It's a different key card screen should be shown. Or at least, until this screen is implemented for this flow, we should show Keycard not empty screen.

    @pavloburykh
    Copy link
    Contributor

    @ilmotta some updates on this PR:

    Following discussions between @flexsurfer and @xAlisher, it was decided to completely remove the separate Keycard reset flow for cases where the Keycard contains the current Profile keys (@flexsurfer can expand on this if needed). From now on, the reset flow will be unified, regardless of whether the Keycard holds current Profile keys or Unknown/Other keys. You can find the updated flow here.

    Therefore, the following issues are not valid anymore:

    1. Issue 2. Successful reset button shouldn't be "Done" - according to new design it will always be Done now and there is no logout button anymore since it was only for the case when Keycard contained current Profile keys on it.
    2. Issue 5. Bottom sheet to factory reset is different from Figma - designs have been updated, and app is aligned with designs now.

    Issues which are valid but should be logged/discussed separately:

    1. Issue 4. Biometrics are still active after profile migration to keycard

    2. Issue 1. User is locked out after successful reset - this one should be discussed separately with @xAlisher. According to the new design after successful migration user is not logged out anymore but redirected to the Keycard home screen Doesn't seem it somehow fixes the problem, as user will still be locked out after performing manual logout. Although, it worth mentioning that in the updated text in Factory reset bottom sheet we explain user all the consequences of resetting Keycard which contains current Profile keys.

    IMPORTANT: as a part of recent changes, Alisher has updated Keycard home screen BUT current PR does not reflect these changes and according to @flexsurfer they will be implemented in a separate PR. Current PR uses the old screen.

    @ilmotta
    Copy link
    Contributor

    ilmotta commented Jan 17, 2025

    Thanks @pavloburykh for the detailed heads up 💯

    Issue 1. User is locked out after successful reset - this one should be discussed separately with @xAlisher.

    The new text does improve things and it seems to be sufficient for now. As long as we are being upfront and straightforward about the actions that will take place after reset, I think the current UX & copy is sufficient. Over time we will be able to get good feedback from users, and maybe they will have something to say about this part of the flow.

    Issue 4. Biometrics are still active after profile migration to keycard

    Sure, this one I mentioned originally to @flexsurfer that it is unrelated to this PR. Can be tracked as a separate GH issue 👍🏼

    Copy link
    Contributor

    @ilmotta ilmotta left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Approving since I don't have anything else to add to the PR code-wise, code LGTM.

    {:title (i18n/label :t/keycard-reset-success)
    :description :text
    :description-text (i18n/label :t/keycard-empty-ready)}]
    [rn/view {:style {:flex 1}}]
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Quick one, what is this rn/view for? It doesn't have any content or size, that's why I'm asking. File src/status_im/contexts/keycard/different_card/view.cljs also has this same empty rn/view.

    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    @flexsurfer probably my comment got lost in the myriad of comments in the PR, but could you elaborate on my question above?

    Copy link
    Member Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    oh sorry @ilmotta that true, I missed your comment, this view just pushes next view to the bottom

    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ah okay it's really necessary. Thanks for the explanation!

    @flexsurfer flexsurfer force-pushed the feature/Keycard-Factory-reset-a-Keycard-#21578 branch from 787916c to 5ba2af9 Compare January 20, 2025 09:56
    @flexsurfer
    Copy link
    Member Author

    thank you @pavloburykh
    Issue 3. will be fixed in design
    ISSUE 7 fixed
    ISSUE 8 lets do it as separate issue

    @pavloburykh
    Copy link
    Contributor

    @flexsurfer thanks for the PR. Ready for merge now.

    @flexsurfer flexsurfer merged commit be13473 into develop Jan 20, 2025
    5 checks passed
    @flexsurfer flexsurfer deleted the feature/Keycard-Factory-reset-a-Keycard-#21578 branch January 20, 2025 11:35
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: DONE
    Development

    Successfully merging this pull request may close these issues.

    Keycard - Factory reset a Keycard
    5 participants