Skip to content

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!

- 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.
@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

@status-im-auto
Copy link
Member

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.

3 participants