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

fix: use proper LocalPairingState #17328

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Conversation

igor-sirotin
Copy link
Contributor

Fixes #17283

Description

ProgressState was used instead of the LocalPairingState. Fixed that.

Screenshot

Screen.Recording.2025-02-18.at.18.13.01.mov

@igor-sirotin igor-sirotin self-assigned this Feb 18, 2025
@igor-sirotin igor-sirotin requested review from alexjba and a team as code owners February 18, 2025 15:16
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

👍

With a small suggestion

@@ -11,7 +12,7 @@ QtObject:
View* = ref object of QObject
delegate: io_interface.AccessInterface
keycardEvent: KeycardEventDto
syncState: int
syncState: LocalPairingState
Copy link
Member

Choose a reason for hiding this comment

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

Right, I think it makes sense to fix the below types to, to prevent future errors like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but we agreed that we should group other keycard command states, so I decided not to touch them here.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah but why can't they use the proper (same) type, instead of a plain int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They can and should, I just don't like mixing fixes in a single pr

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, eventhough a separate commit would do for me :)

@status-im-auto
Copy link
Member

status-im-auto commented Feb 18, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 2b8d487 #1 2025-02-18 15:24:18 ~7 min macos/aarch64 🍎dmg
✔️ 2b8d487 #1 2025-02-18 15:26:11 ~9 min tests/nim 📄log
2b8d487 #1 2025-02-18 15:30:53 ~13 min tests/ui 📄log
✔️ 2b8d487 #1 2025-02-18 15:32:06 ~14 min macos/x86_64 🍎dmg
✔️ 2b8d487 #1 2025-02-18 15:39:55 ~22 min linux-nix/x86_64 📦tgz
✔️ 2b8d487 #1 2025-02-18 15:41:00 ~23 min linux/x86_64 📦tgz
✔️ 2b8d487 #1 2025-02-18 15:45:57 ~28 min windows/x86_64 💿exe
2b8d487 #2 2025-02-18 16:55:11 ~13 min tests/ui 📄log
2b8d487 #3 2025-02-19 14:28:35 ~12 min tests/ui 📄log
✔️ 4db2e02 #2 2025-02-20 08:12:50 ~6 min macos/aarch64 🍎dmg
✔️ 4db2e02 #2 2025-02-20 08:14:57 ~8 min tests/nim 📄log
✔️ 4db2e02 #2 2025-02-20 08:20:55 ~14 min macos/x86_64 🍎dmg
✔️ 4db2e02 #5 2025-02-20 08:21:19 ~14 min tests/ui 📄log
✔️ 4db2e02 #2 2025-02-20 08:26:31 ~20 min linux/x86_64 📦tgz
✔️ 4db2e02 #2 2025-02-20 08:28:25 ~22 min linux-nix/x86_64 📦tgz
✔️ 4db2e02 #2 2025-02-20 08:35:03 ~28 min windows/x86_64 💿exe

Copy link
Member

@micieslak micieslak left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -12,7 +12,7 @@ import AppLayouts.Onboarding.enums 1.0
OnboardingPage {
id: root

required property int syncState // Onboarding.ProgressState.xxx
required property int syncState // Onboarding.LocalPairingState.xxx
Copy link
Member

Choose a reason for hiding this comment

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

Not a problem of that pr, but in general using nim side counterparts of enums in pure UI components is not optimal in general for couple reasons:

  1. Once the backend enum is changed, the UI component must be updated even if visually nothing changed (SRP)
  2. The states of the external enum may not reflect the need of the UI component itself, like in that case where we need to do mapping from two states into one, deeply in ui component.

Ideally the states of the UI component should be defined by the component itself, and mapped to nim/backend states in upper level, responsible for that mapping. The drawback is maintaining mapping itself, but when gathered in single place responsible exclusively for that it should result with better and cleaner design.

As mentioned, nothing to change in that pr but raising problem for further consideration.

@igor-sirotin igor-sirotin force-pushed the fix/17283-local-pairing branch from 2b8d487 to 4db2e02 Compare February 20, 2025 08:06
@igor-sirotin igor-sirotin merged commit 1959bca into master Feb 20, 2025
9 checks passed
@igor-sirotin igor-sirotin deleted the fix/17283-local-pairing branch February 20, 2025 08:48
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.

New onboarding: sync devices is broken
4 participants