Skip to content

Comments

fix(keycard): Improve exception handling#19546

Merged
alexjba merged 14 commits intofeat/keycard-nfcfrom
fix/keycard-nfc-1
Jan 14, 2026
Merged

fix(keycard): Improve exception handling#19546
alexjba merged 14 commits intofeat/keycard-nfcfrom
fix/keycard-nfc-1

Conversation

@alexjba
Copy link
Contributor

@alexjba alexjba commented Dec 10, 2025

What does the PR do

Iterates #19545

Preparing the nim code to work with status-keycard-qt. Had a few cases where the current nim code had to be updated. Probably because the status-keycard-qt internals are not identical to status-keycard-go.

  • src/app/modules/main/wallet_section/send_new/module.nim Verify if both password and pin are empty before emitting the authenticationCancelled signal
  • src/app/modules/shared_modules/keycard_popup/internal/insert_keycard_state.nim (and the other changes in states) handle card disconnect/reconnect when the user input is needed (enter pin, puk etc)
  • treat keycard message with empty error as successful
  • src/app_service/service/keycard/service.nim - avoid modifying the json container with itself. We're currently iterating the container and modifying the service member - leading to a freeze.

NOTE: Tests can be done in the final PR #19549

@status-im-auto
Copy link
Member

✔️ status-desktop/prs/android/arm64/package/PR-19546#1 🔹 ~9 min 51 sec 🔹 00978e3e 🔹 📦 android/arm64 package

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

✔️ status-desktop/e2e/prspr19546 🔹 ~14 min 🔹 3eacf69 🔹 📦 tests/e2e package

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member


method onUserAuthenticated*(self: Module, password: string, pin: string) =
if password.len == 0:
if password.len == 0 and pin.len == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

A password should be set in both cases, regular/keycard user, while pin only for the keycard user, that's why only password was checked. It's not incorrect this way ofc.

if keycardFlowType == ResponseTypeValueKeycardFlowResult:
if keycardEvent.error.len > 0:
if keycardEvent.error == ErrorOk:
if keycardEvent.error == ErrorOk or keycardEvent.error.len == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

We're here only if the keycardEvent.error.len > 0 parent condition, so not needed toc check if keycardEvent.error.len == 0 here, cause will always be false. The same in 4 conditions below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed these changes. Thanks!

@status-im-auto
Copy link
Member

✔️ status-app/prs/linux/x86_64/tests-nim/PR-19546#4 🔹 ~8 min 29 sec 🔹 58d65b8 🔹 📦 tests/nim package

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

- src/app/modules/main/wallet_section/send_new/module.nim Verify if both password and pin are empty before emitting the `authenticationCancelled` signal
- handle card disconnect/reconnect when the user input is needed (enter pin, puk etc)
- treat keycard message with empty error as successful
- src/app_service/service/keycard/service.nim - avoid modifying the json container with itself. We're currently iterating the container and modifying the service member - leading to a freeze.
this commit updates the makefile to determine some of the keycard lib link params based on a single argument - the lib path
This is a fix for the mobile platforms that will show a drawer when the keycard is needed. We'll need to avoid showing the drawer every time at app start.
The keycard channel events will inform the app of the channel state (waiting for keycard, reading, error, idle). This will be used on mobile platforms to control a drawer that informs the user when it's required to tap the keycard.
…keycard interactions

Adding a `KeycardChannelDrawer` that's guiding the user whenever the keycard is needed.

On IOS the system drawer is used
…ponents

- use a single KeycardStateDisplay instance with the necessary states
- The state queue, transitions and entire logic moved to KeycardChannelStateManager component
- Adding states for HW adaptor states
- Implement `Dismiss` action
…ing blocked

This commit updates parts of the login flows. Adds a new `Scan keycard` button to trigger keycard detection on demand.
+ Update keycard states in the login flow
+ Show digits only on soft keyboard for pin input

to squash - fix: User needs to be able to dismiss the keycard drawer without getting blocked
@alexjba alexjba merged commit 95ea926 into feat/keycard-nfc Jan 14, 2026
1 of 7 checks passed
@alexjba alexjba deleted the fix/keycard-nfc-1 branch January 14, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants