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

Changing the PIN of the Keycard #22008

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

Parveshdhull
Copy link
Member

@Parveshdhull Parveshdhull commented Feb 2, 2025

fixes #21951

design: https://www.figma.com/design/YGm3igIOAcwMqUVJWCJ6f1/Keycard?version-id=2180813677654249055&node-id=3-89231&p=f&viewport=12277%2C12303%2C0.24&t=on1Bz6OzgOy5dE0v-0

Video

signal-2025-02-02-174544.mp4

Testing Note:

  • The illustrations are not yet ready in Figma.
  • The visibility of "Changing PIN" is too brief. As I mentioned in my last PR, point 3, we should just remove these screens. (also see Changing the PIN of the Keycard #22008 (comment)) (upd: removed)
  • We are using the same codebase and error handling for all keycard flows. Please do not re-report the issues mentioned in Keycard flow UI issues #21970; they already exist in the develop branch and are not leftovers or regressions, and they need to be handled separately
  • We have not yet implemented biometric authentication for any keycard flow, including this one.

status: ready

Found Issues

  1. PIN of another keycard can be changed during the flow

    • Fixed (checked by dev)
    • Verified (checked by QA)
  2. Second scanning stucks after user scaned not a Keycard

    • Fixed (checked by dev)
    • Verified (checked by QA)
  3. Enter PIN screen appears if Keycard scanning was interrupted during PIN change

    • Fixed (checked by dev)
    • Verified (checked by QA)

@status-im-auto
Copy link
Member

status-im-auto commented Feb 2, 2025

Jenkins Builds

Click to see older builds (44)
Commit #️⃣ Finished (UTC) Duration Platform Result
da8d006 #1 2025-02-02 10:06:43 ~3 min tests 📄log
✔️ e098ec3 #2 2025-02-02 10:13:54 ~4 min tests 📄log
✔️ e098ec3 #2 2025-02-02 10:16:14 ~6 min android-e2e 🤖apk 📲
✔️ e098ec3 #2 2025-02-02 10:16:43 ~7 min android 🤖apk 📲
✔️ e098ec3 #2 2025-02-02 10:19:55 ~10 min ios 📱ipa 📲
✔️ b28a7d2 #3 2025-02-02 10:47:38 ~4 min tests 📄log
✔️ b28a7d2 #3 2025-02-02 10:49:59 ~6 min android-e2e 🤖apk 📲
✔️ b28a7d2 #3 2025-02-02 10:51:27 ~8 min android 🤖apk 📲
✔️ b28a7d2 #3 2025-02-02 10:53:17 ~10 min ios 📱ipa 📲
✔️ b128ae3 #4 2025-02-02 12:08:51 ~4 min tests 📄log
✔️ b128ae3 #4 2025-02-02 12:11:45 ~7 min android 🤖apk 📲
✔️ b128ae3 #4 2025-02-02 12:12:10 ~7 min android-e2e 🤖apk 📲
✔️ b128ae3 #4 2025-02-02 12:13:47 ~9 min ios 📱ipa 📲
9b6a9a7 #5 2025-02-03 06:51:43 ~2 min tests 📄log
✔️ a27e688 #6 2025-02-03 07:00:49 ~5 min tests 📄log
✔️ a27e688 #6 2025-02-03 07:01:50 ~6 min android-e2e 🤖apk 📲
✔️ a27e688 #6 2025-02-03 07:04:46 ~9 min android 🤖apk 📲
✔️ a27e688 #6 2025-02-03 07:07:04 ~11 min ios 📱ipa 📲
d793970 #7 2025-02-03 08:45:09 ~3 min tests 📄log
2364278 #8 2025-02-03 08:48:57 ~2 min tests 📄log
✔️ 6e230f4 #9 2025-02-03 08:57:40 ~4 min tests 📄log
✔️ 6e230f4 #9 2025-02-03 09:00:29 ~7 min android-e2e 🤖apk 📲
✔️ 6e230f4 #9 2025-02-03 09:00:54 ~8 min android 🤖apk 📲
✔️ 6e230f4 #9 2025-02-03 09:02:39 ~10 min ios 📱ipa 📲
✔️ 5e17cc1 #10 2025-02-03 15:34:38 ~4 min tests 📄log
✔️ 5e17cc1 #10 2025-02-03 15:38:15 ~8 min android-e2e 🤖apk 📲
✔️ 5e17cc1 #10 2025-02-03 15:38:58 ~8 min android 🤖apk 📲
✔️ 5e17cc1 #10 2025-02-03 15:39:42 ~9 min ios 📱ipa 📲
✔️ 495967e #12 2025-02-03 15:52:13 ~4 min tests 📄log
✔️ 495967e #12 2025-02-03 15:54:11 ~6 min android-e2e 🤖apk 📲
✔️ 495967e #12 2025-02-03 15:55:07 ~7 min android 🤖apk 📲
✔️ 495967e #12 2025-02-03 15:57:11 ~9 min ios 📱ipa 📲
✔️ f86e56a #13 2025-02-04 08:32:28 ~4 min tests 📄log
✔️ f86e56a #13 2025-02-04 08:34:57 ~6 min android-e2e 🤖apk 📲
✔️ f86e56a #13 2025-02-04 08:36:09 ~8 min android 🤖apk 📲
✔️ f86e56a #13 2025-02-04 08:38:28 ~10 min ios 📱ipa 📲
✔️ f6d433f #14 2025-02-04 10:25:54 ~4 min tests 📄log
✔️ f6d433f #14 2025-02-04 10:28:20 ~6 min android-e2e 🤖apk 📲
✔️ f6d433f #14 2025-02-04 10:28:37 ~7 min android 🤖apk 📲
✔️ f6d433f #14 2025-02-04 10:31:00 ~9 min ios 📱ipa 📲
✔️ 2f78ee0 #15 2025-02-04 12:47:58 ~4 min tests 📄log
✔️ 2f78ee0 #15 2025-02-04 12:51:09 ~7 min android-e2e 🤖apk 📲
✔️ 2f78ee0 #15 2025-02-04 12:51:39 ~8 min android 🤖apk 📲
✔️ 2f78ee0 #15 2025-02-04 12:54:36 ~11 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a26be7c #17 2025-02-05 10:08:36 ~4 min tests 📄log
✔️ a26be7c #17 2025-02-05 10:10:35 ~6 min android-e2e 🤖apk 📲
✔️ a26be7c #17 2025-02-05 10:10:55 ~7 min android 🤖apk 📲
✔️ a26be7c #17 2025-02-05 10:14:11 ~10 min ios 📱ipa 📲
✔️ 091dda9 #18 2025-02-05 15:02:05 ~4 min tests 📄log
✔️ 091dda9 #18 2025-02-05 15:04:24 ~6 min android-e2e 🤖apk 📲
✔️ 091dda9 #18 2025-02-05 15:05:52 ~8 min android 🤖apk 📲
✔️ 091dda9 #18 2025-02-05 15:07:58 ~10 min ios 📱ipa 📲

Comment on lines 158 to 161
(rf/reg-event-fx :keycard/connect
(rf/reg-event-fx :keycard/update-event-vector-and-dispatch
(fn [{:keys [db]} [{:keys [key-uid on-success on-error on-connect-event-vector]}]]
(let [event-vector
(or on-connect-event-vector
Copy link
Member Author

@Parveshdhull Parveshdhull Feb 2, 2025

Choose a reason for hiding this comment

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

As mentioned in this comment, we store the on-connect-event-vector at the start of the flow when calling :keycard/connect, but we don’t update this event vector. As a result, when the card is reconnected, we dispatch the stored event instead of the event corresponding to the current flow position. To address this, I created a separate event for updating and dispatching the current keycard event, and used for the change-pin flow.

Copy link
Member

Choose a reason for hiding this comment

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

sorry @Parveshdhull i somehow missed this, could you please explain why is this needed this for the change-pin flow. thanks

Copy link
Member Author

@Parveshdhull Parveshdhull Feb 3, 2025

Choose a reason for hiding this comment

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

Hi Andrey,

When we call :keycard/connect, we store the corresponding event in the on-card-connected-event-vector in the database. Later, if the card gets disconnected and reconnected, we use the stored value and dispatch it again. This is problematic, as I mentioned in #21918 and in our Discord DM, because we only create the on-card-connected-event-vector at the start of the flow and don't update it afterward.

For example, in the change-pin flow:

  • On :keycard/connect, we store the verify-pin-and-continue event and dispatch it, which is then used to open the changing-pin modal (although this is no longer the case). Afterward, we dispatch change-pin-and-continue.

  • If the card gets reconnected before change-pin-and-continu is dispatched/completed, it will re-trigger the stored verify-pin-and-continue event and open the changing-pin modal again (no longer the case, will just redispatch change-pin-and-continue again but using modal example to highlight the issue)

  • A similar issue occurred in "keycard is not empty" screen shown if keycard moved during create profile flow with keycard migration #21818

We need to account for scenarios where the keycard is moved or reconnected and ensure that we update the on-card-connected-event-vector with the latest position in the keycard flow, instead of dispatching the original event again.

Please Let me know if my explanation is unclear, and please search for on-card-connected-event-vector in our codebase; its lifecycle might be more helpful.

Copy link
Member

Choose a reason for hiding this comment

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

When we call :keycard/connect, we store the corresponding event in the on-card-connected-event-vector in the database. Later, if the card gets disconnected and reconnected, we use the stored value and dispatch it again.

yes that's expected, and that's how it should work, if you need to update on-card-connected-event-vector something wrong with the flow then, and flow should be fixed instead, if on-card-connected-event-vector will be changed in the middle of connection flow it will be really hard to develop and maintain

Copy link
Member

Choose a reason for hiding this comment

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

btw i don't see in the change-pin flow there on-card-connected-event-vector update would be needed

Copy link
Member Author

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 discussion and your help.

Review Note: Reverted related change, these will be further discussed in #21971

@Parveshdhull Parveshdhull force-pushed the feat/keycard-change-ping branch 2 times, most recently from e098ec3 to b28a7d2 Compare February 2, 2025 10:42
Copy link
Member

@flexsurfer flexsurfer left a comment

Choose a reason for hiding this comment

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

hey @Parveshdhull thank you for PR, great job, i left a few comments, major conern about modal logic changes, i would revert this changes, im not sure why we need to have two modals. Also you can ask Alisher to remove Changing Keycard PIN from figma, because this screen is not needed actually

src/status_im/contexts/keycard/pin/create/view.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/keycard/change_pin/events.cljs Outdated Show resolved Hide resolved
src/status_im/navigation/core.cljs Outdated Show resolved Hide resolved
src/status_im/navigation/core.cljs Outdated Show resolved Hide resolved
@Parveshdhull Parveshdhull force-pushed the feat/keycard-change-ping branch from a27e688 to d793970 Compare February 3, 2025 08:40
@Parveshdhull
Copy link
Member Author

Thank you, @flexsurfer, for reviewing the PR.

  1. Removed the changing-keycard-pin screen.
  2. For the create-pin screen, the "New" keyword is important (confirmed with Alisher), so I passed the title as a parameter.
  3. Removed navigation state management code, except for one small instance, which I believe will help avoid potential bugs in the future (only push the modal to the state when opening it).

:type :modal})))
options/sheet-options))}}]}})
(state/navigation-state-push {:id component
:type :modal})))))
Copy link
Member

Choose a reason for hiding this comment

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

did something change here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes,

Removed navigation state management code, except for one small instance, which I believe will help avoid potential bugs in the future (only push the modal to the state when opening it).

Copy link
Member

@flexsurfer flexsurfer left a comment

Choose a reason for hiding this comment

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

well done, thank you

@mariia-skrypnyk mariia-skrypnyk self-assigned this Feb 3, 2025
@status-im-auto
Copy link
Member

64% of end-end tests have passed

Total executed tests: 11
Failed tests: 4
Expected to fail tests: 0
Passed tests: 7
IDs of failed tests: 741555,703133,702742,702843 

Failed tests (4)

Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Test setup failed: critical/chats/test_public_chat_browsing.py:23: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(1)
    base_test_case.py:188: in create_shared_drivers
        drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name,
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:20: in start_threads
        returns[k] = await returns[k]
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:257: in __init__
        super().__init__(
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:206: in __init__
        self.start_session(capabilities)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:346: in start_session
        response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py:229: in check_response
        raise exception_class(message, screen, stacktrace)
     1738574369325765349: Oops, Unable to allocate device. Please check input capabilities.: Kafka write errors (1/1), errors: <b>[[6] Not Leader For Partition: the client attempted to send messages to a replica that is not the leader for some partition, the client's metadata are likely out of date]
    



    2. test_community_copy_and_paste_message_in_chat_input, id: 702742

    Test setup failed: critical/chats/test_public_chat_browsing.py:23: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(1)
    base_test_case.py:188: in create_shared_drivers
        drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name,
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:20: in start_threads
        returns[k] = await returns[k]
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:257: in __init__
        super().__init__(
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:206: in __init__
        self.start_session(capabilities)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:346: in start_session
        response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py:229: in check_response
        raise exception_class(message, screen, stacktrace)
     1738574369325765349: Oops, Unable to allocate device. Please check input capabilities.: Kafka write errors (1/1), errors: <b>[[6] Not Leader For Partition: the client attempted to send messages to a replica that is not the leader for some partition, the client's metadata are likely out of date]
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Test setup failed: critical/chats/test_public_chat_browsing.py:314: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(2)
    base_test_case.py:188: in create_shared_drivers
        drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name,
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:20: in start_threads
        returns[k] = await returns[k]
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:257: in __init__
        super().__init__(
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:206: in __init__
        self.start_session(capabilities)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:346: in start_session
        response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py:229: in check_response
        raise exception_class(message, screen, stacktrace)
     1738574369328963408: Oops, Unable to allocate device. Please check input capabilities.: Kafka write errors (1/1), errors: <b>[[6] Not Leader For Partition: the client attempted to send messages to a replica that is not the leader for some partition, the client's metadata are likely out of date]
    



    Class TestWalletOneDevice:

    1. test_wallet_swap_flow_mainnet, id: 741555

    Device 1: Swiping right on element SlideButton
    Device 1: Find SlideButton by xpath: //*[@resource-id='slide-button-track']

    critical/test_wallet.py:430: in test_wallet_swap_flow_mainnet
        self.errors.verify_no_errors()
    base_test_case.py:179: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: Mainnet: Spending cap is not shown on the 'Set Spending Cap' screen
    E    Device 1: Mainnet: Text Account 1 is not shown for the account on the 'Set Spending Cap' screen
    E    Device 1: Mainnet: Text 0x83d...49e is not shown for the account on the 'Set Spending Cap' screen
    E    Device 1: Mainnet: Token is not shown on the 'Set Spending Cap' screen
    E    Device 1: Mainnet: Spender contract info is missing on the 'Set Spending Cap' screen
    E    Device 1: Mainnet: Network is not shown on the 'Set Spending Cap' screen
    E    Device 1: Mainnet: can't sign swap
    



    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 TestWalletMultipleDevice:

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

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490
    3. test_wallet_bridge_flow_mainnet, id: 741612
    4. test_wallet_send_flow_mainnet, id: 741554

    @Parveshdhull
    Copy link
    Member Author

    Parveshdhull commented Feb 3, 2025

    Thank you very much, @mariia-skrypnyk, for taking the PR for testing.

    Apologies for adding another commit. It was related to a small latest review change request and shouldn't have affected the PR. I will also test it manually to ensure everything is fine

    @Parveshdhull Parveshdhull force-pushed the feat/keycard-change-ping branch from 3d468b6 to 495967e Compare February 3, 2025 15:47
    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.

    Thank you for working on this PR @Parveshdhull. I have a few concerns and suggestions, but hopefully nothing major.

    src/status_im/contexts/keycard/change_pin/events.cljs Outdated Show resolved Hide resolved
    src/status_im/contexts/keycard/change_pin/events.cljs Outdated Show resolved Hide resolved
    :on-press cleanup-change-pin-data}]
    [quo/page-top
    {:title (i18n/label :t/ready-to-change-pin)}]
    [rn/view {:style {:flex 1 :align-items :center :justify-content :center}}
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    This line is being duplicated too much. As of this PR, I see it duplicated 12 times across keycard namespaces. We can simply create a style namespace at contexts/keycard/ for example and reuse. Or even simpler have a common component using this style map and reuse it across keycard views.

    Not a blocker for this PR, but I think we can do better in a subsequent PR.

    @@ -335,6 +335,9 @@
    "change-password-old-password-placeholder": "Enter current password",
    "change-password-repeat-password-placeholder": "Repeat new password",
    "change-pin": "Change 6-digit passcode",
    "change-pin-keycard": "Change PIN",
    "change-pin-keycard-description": "Use different PIN for this Keycard",
    "change-pin-keycard-message": "It’s very important that you will not forget new PIN. Status is unable to restore PIN. If you forget it, Keycard will be blocked and you will need to restore it via recovery phrase or PUK.",
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Although I'm not a native speaker and I make plenty of mistakes when I write, I see a few small English issues in this sentence. I prefer if we nail the text straight from the very first PR doing the implementation (also to avoid rework).

    Personally, I immediately raise a red flag when I use apps with certain grammatical mistakes. I've seen other translations with less than ideal English text in the Keycard screens or which could feel more natural (separate problem).

    We can further discuss this with @benjthayer outside this PR. Not a blocker for this PR @Parveshdhull, but something we should improve across all features we work on. cc @xAlisher

    src/status_im/contexts/keycard/change_pin/events.cljs Outdated Show resolved Hide resolved
    src/status_im/contexts/keycard/change_pin/events.cljs Outdated Show resolved Hide resolved
    @Parveshdhull
    Copy link
    Member Author

    Thank you, @ilmotta, for reviewing the PR. I have made the required changes.

    @mariia-skrypnyk
    Copy link

    Hi @Parveshdhull !

    Can you mention what design version did you use during development?

    @Parveshdhull
    Copy link
    Member Author

    Hi @Parveshdhull !

    Can you mention what design version did you use during development?

    Hi @mariia-skrypnyk, the issue #21951 refers to the design being used. I've also updated the PR description with the link. Thank you!

    @mariia-skrypnyk
    Copy link

    Please, take a look at the issue below.

    Issue 1: PIN of another keycard can be changed during the flow

    Precondition:

    Keycard 1 - contains key pair of Profile 1
    Keycard 2 - contains key pair of Profile 2

    Steps:

    1. Login to Profile 1 using Keycard 1
    2. Go to Profile -> Keycard
    3. Scan Keycard 1
    4. Enter PIN of Keycard 1 and go next
    5. Enter new PIN and repeat (e.g. 0000)
    6. Scan Keycard 2
    7. Do a logout from Profile 1 and login to Profile 2 using Keycard 2 with "0000" PIN

    Actual result: Keycard 2 PIN has changed and user can successfully use it during login
    Expected result: we should have validation of a wrong (not with our key pair) Keycard scanned after new PIN entering

    https://www.figma.com/design/YGm3igIOAcwMqUVJWCJ6f1/Keycard?node-id=3796-43009&m=dev

    Screenshot 2025-02-04 at 10 57 31

    Question 1

    Is there any reason that User Name didn't included into your implementation?
    Thanks.

    Screenshot 2025-02-04 at 10 49 11 Screenshot 2025-02-04 at 10 49 51

    https://www.figma.com/design/YGm3igIOAcwMqUVJWCJ6f1/Keycard?node-id=3770-54000&m=dev

    @Parveshdhull
    Copy link
    Member Author

    Thank you, @mariia-skrypnyk, for finding this issue. It should be fixed now.

    Note: It will now display "Keycard is not empty" (known issue - #21647).

    Is there any reason that User Name didn't included into your implementation?

    I’m not sure if this information or feature is unavailable, but since I didn’t see it in the other keycard flows, I skipped it here as well.

    @flexsurfer, could you please clarify whether we should retrieve this name from the keycard or use the profile name?

    @flexsurfer
    Copy link
    Member

    @flexsurfer, could you please clarify whether we should retrieve this name from the keycard or use the profile name?

    we need to discuss this with Alisher, currently we show profile's name, but it doesn't make any sense, i would remove this, because we don't have name for the card

    @mariia-skrypnyk
    Copy link

    @Parveshdhull checking your fix, thanks!

    we need to discuss this with Alisher

    Would be great, tag me please in that conversation.

    @mariia-skrypnyk
    Copy link

    Thanks for fix, still testing but found extra one.

    ISSUE 2: Second scanning stucks after user scaned not a Keycard

    Precondition:

    Keycard 1 - contains key pair of Profile 1
    Bank card

    Steps:

    1. Login to Profile 1
    2. Go to Profile -> Keycard
    3. Scan a Keycard 1
    4. Enter PIN
    5. Enter a new PIN
    6. Scan your Bank card
    7. Tap on X or Try again and scan one more time your Bank card or Keycard 1 (no matter)
    8. Try flow one more time

    Result: scanning stucks, after retry user sees Oops screen again

    IMG_5925.MP4

    logs_ scanning.zip

    Expected result: X or Try again should give an ability to user to continue flow successfully

    @Parveshdhull
    Copy link
    Member Author

    ISSUE 2: Second scanning stucks after user scaned not a Keycard

    Thank you, should be fixed now

    @Parveshdhull Parveshdhull force-pushed the feat/keycard-change-ping branch from f6d433f to 2f78ee0 Compare February 4, 2025 12:43
    @mariia-skrypnyk
    Copy link

    mariia-skrypnyk commented Feb 4, 2025

    @Parveshdhull

    Issue 3: Enter PIN screen appears if Keycard scanning was interrupted during PIN change

    Steps:

    1. Login to Profile
    2. Go to Profile -> Keycard
    3. Scan a Keycard
    4. Enter PIN
    5. Enter a new PIN
    6. Scan Keycard but try to interrupt scanning 2-3 times by moving your card

    Result:

    Reported issue starts from 0:23 sec

    IMG_5931.MP4

    Expected result: scanner should not be closed and Enter PIN screen should not appear

    @mariia-skrypnyk
    Copy link

    Hey @Parveshdhull!

    Quick question—do I need to check the biometrics flow? The only way I see it turning on is by creating a Profile, migrating the key pair to a Keycard, and then changing the PIN. However, the result isn’t exactly as shown in Figma, so I’m wondering if this might be out of scope.

    What do you think? 😊

    @ilmotta
    Copy link
    Contributor

    ilmotta commented Feb 5, 2025

    Hey @Parveshdhull!

    Quick question—do I need to check the biometrics flow? The only way I see it turning on is by creating a Profile, migrating the key pair to a Keycard, and then changing the PIN. However, the result isn’t exactly as shown in Figma, so I’m wondering if this might be out of scope.

    What do you think? 😊

    @mariia-skrypnyk @Parveshdhull we deprioritized support for biometrics with keycards in 2.32 and 2.33 to give room for other features. Right now if we migrate a profile which had biometrics enabled, we incorrectly verify via biometrics before the keycard is scanned to log in (logged in #21956). The only meaningful thing a user can do is disable biometrics from settings after migrating profile to keycard to mitigate the bug.

    @Parveshdhull
    Copy link
    Member Author

    Enter PIN screen appears if Keycard scanning was interrupted during PIN change

    Thank you @mariia-skrypnyk for finding this interesting issue. Should be fixed now.

    @Parveshdhull Parveshdhull force-pushed the feat/keycard-change-ping branch from ebb49f6 to a26be7c Compare February 5, 2025 10:03
    @status-im-auto
    Copy link
    Member

    55% of end-end tests have passed

    Total executed tests: 11
    Failed tests: 5
    Expected to fail tests: 0
    Passed tests: 6
    
    IDs of failed tests: 727231,741555,740490,741612,741554 
    

    Failed tests (5)

    Click to expand
  • Rerun failed tests

  • Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    # STEP: Adding new regular account
    Device 1: Find `Button` by `accessibility id`: `add-account`

    critical/test_wallet.py:551: in test_wallet_add_remove_regular_account
        self.wallet_view.add_regular_account(account_name=new_account_name)
    ../views/wallet_view.py:215: in add_regular_account
        self.add_account_button.click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `add-account` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    2. test_wallet_swap_flow_mainnet, id: 741555

    Device 1: Could not reach Button by pressing system back button
    Device 1: Find Button by xpath: //android.view.ViewGroup[contains(@content-desc,'Account 1')]

    critical/test_wallet.py:349: in test_wallet_swap_flow_mainnet
        self.wallet_view.get_account_element().click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//android.view.ViewGroup[contains(@content-desc,'Account 1')]` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    3. test_wallet_balance_mainnet, id: 740490

    Device 1: Find AssetElement by xpath: //android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='USDCoin']
    Device 1: Find AssetElement by xpath: //android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='USDCoin']

    critical/test_wallet.py:239: in test_wallet_balance_mainnet
        real_balance[asset] = self.wallet_view.get_asset(asset).get_amount()
    ../views/wallet_view.py:166: in get_asset
        element.scroll_to_element(down_start_y=0.89, down_end_y=0.8)
    ../views/base_element.py:196: in scroll_to_element
        raise NoSuchElementException(
     Device 1: AssetElement by xpath: `//android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='USDCoin']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    4. test_wallet_bridge_flow_mainnet, id: 741612

    Device 1: Could not reach Button by pressing system back button
    Device 1: Find Button by xpath: //android.view.ViewGroup[contains(@content-desc,'Account 1')]

    critical/test_wallet.py:434: in test_wallet_bridge_flow_mainnet
        self.wallet_view.get_account_element().click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//android.view.ViewGroup[contains(@content-desc,'Account 1')]` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    5. test_wallet_send_flow_mainnet, id: 741554

    # STEP: Checking the send flow for Ether on Mainnet
    Device 1: Find Button by xpath: //*[@content-desc='token-network']/android.widget.TextView[@text='Ether']

    critical/test_wallet.py:280: in test_wallet_send_flow_mainnet
        self.wallet_view.select_asset(asset)
    ../views/wallet_view.py:171: in select_asset
        xpath="//*[@content-desc='token-network']/android.widget.TextView[@text='%s']" % asset_name).click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[@content-desc='token-network']/android.widget.TextView[@text='Ether']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Passed tests (6)

    Click to expand

    Class TestWalletMultipleDevice:

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

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    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

    @mariia-skrypnyk
    Copy link

    Hi @Parveshdhull !

    Thanks for the final fix.
    testing is done and here are my small report:

    Platforms: iOS & Android
    Test Scenarios:
    ✅ Entering an invalid PIN code
    ✅ Changing the PIN to the same one
    ✅ Changing the PIN to a different one
    ✅ Interrupting the flow by using a non-Keycard
    ✅ Repeating the flow multiple times
    ✅ Verifying if the user can log in with the new PIN
    ✅ Checking if the user can sign a transaction and add an account with the new PIN

    Everything worked as expected unless specified otherwise. Let me know if further details are needed! 🚀

    Failed E2E are not related
    PR can be merged!

    @Parveshdhull Parveshdhull force-pushed the feat/keycard-change-ping branch from a26be7c to 091dda9 Compare February 5, 2025 14:57
    @Parveshdhull Parveshdhull merged commit 1a5008b into develop Feb 5, 2025
    5 checks passed
    @Parveshdhull Parveshdhull deleted the feat/keycard-change-ping branch February 5, 2025 15:11
    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 - Changing the PIN of the Keycard
    5 participants