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

[#21318] Keycard - Allow user to initiate Profile key pair migration … #21359

Conversation

flexsurfer
Copy link
Member

@flexsurfer flexsurfer commented Oct 1, 2024

fixes: #21318

@flexsurfer flexsurfer self-assigned this Oct 1, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Oct 1, 2024

Jenkins Builds

Click to see older builds (4)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 55e5b44 #1 2024-10-01 14:28:47 ~4 min tests 📄log
✔️ 55e5b44 #1 2024-10-01 14:30:44 ~6 min android-e2e 🤖apk 📲
✔️ 55e5b44 #1 2024-10-01 14:31:58 ~8 min android 🤖apk 📲
✔️ 55e5b44 #1 2024-10-01 14:34:06 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d757f02 #2 2024-10-04 14:02:49 ~4 min tests 📄log
✔️ d757f02 #2 2024-10-04 14:05:31 ~7 min android-e2e 🤖apk 📲
✔️ d757f02 #2 2024-10-04 14:06:55 ~8 min android 🤖apk 📲
✔️ d757f02 #2 2024-10-04 14:08:38 ~10 min ios 📱ipa 📲
✔️ 2e25235 #3 2024-10-07 09:32:22 ~4 min tests 📄log
✔️ 2e25235 #3 2024-10-07 09:35:30 ~7 min android-e2e 🤖apk 📲
✔️ 2e25235 #3 2024-10-07 09:36:18 ~8 min android 🤖apk 📲
✔️ 2e25235 #3 2024-10-07 09:38:31 ~10 min ios 📱ipa 📲

@flexsurfer flexsurfer force-pushed the feature/Keycard_-_Allow_user_to_initiate_Profile_key_pair_migration_on_an_empty_Keycard_#21318 branch from 55e5b44 to d757f02 Compare October 4, 2024 13:58
@flexsurfer flexsurfer force-pushed the feature/Keycard_-_Allow_user_to_initiate_Profile_key_pair_migration_on_an_empty_Keycard_#21318 branch from d757f02 to 2e25235 Compare October 7, 2024 09:27
@@ -0,0 +1,42 @@
(ns status-im.contexts.keycard.error.view
Copy link
Member Author

Choose a reason for hiding this comment

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

do not review this screen, is a temporary implementation will be finished in the next PRs

@flexsurfer flexsurfer changed the title [WIP] [#21318] Keycard - Allow user to initiate Profile key pair migration … [#21318] Keycard - Allow user to initiate Profile key pair migration … Oct 7, 2024
Copy link
Member

@seanstrom seanstrom left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks for the PR 🙌
Left a few comments and questions, let me know what you think 🙏

src/status_im/contexts/keycard/events.cljs Show resolved Hide resolved
src/status_im/contexts/keycard/events.cljs Show resolved Hide resolved
src/status_im/feature_flags.cljs Show resolved Hide resolved
Comment on lines +110 to +111
event-vector [:keycard/get-application-info
{:on-success #(rf/dispatch [:keycard/on-get-application-info-success % args])}]]
Copy link
Member

@seanstrom seanstrom Oct 7, 2024

Choose a reason for hiding this comment

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

I think we might need to be careful with storing functions in the database. Maybe it's not a problem in this case, but if we try to serialise the db-state then we may not be able to deserialise the function later.

Copy link
Member Author

@flexsurfer flexsurfer Oct 7, 2024

Choose a reason for hiding this comment

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

i wouldn't think about this much, i mean serializing db ) we should do it how it's better for now, but I agree, I'm also not a fun of such an approach, we could think how we could improve it later

Copy link
Member

Choose a reason for hiding this comment

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

later on if we update the keycard effects to use call-continuation, then we may be able to do something like this:

[:keycard/get-application-info
  {:on-success [:keycard/on-get-application-info-success args]}]

But we would need to refactor :keycard/on-get-application-info-success to the it's arguments in a different order (I think).

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

thank you for the review @seanstrom

@flexsurfer flexsurfer merged commit 80ad2b8 into develop Oct 7, 2024
6 checks passed
@flexsurfer flexsurfer deleted the feature/Keycard_-_Allow_user_to_initiate_Profile_key_pair_migration_on_an_empty_Keycard_#21318 branch October 7, 2024 18:15
Copy link
Contributor

@ulisesmac ulisesmac left a comment

Choose a reason for hiding this comment

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

Hi @flexsurfer !

Thanks for this PR! I left a couple of comments but it looks great at code level in general.

I'd like to ask for a PR description summarizing the changes made and, if possible, a demo video or some screenshots of the implementation running, some steps to test would be also be helpful for reviewers.

I know we aren't asking for QA now, is it because the feature isn't complete yet? If it's testable I'd suggest to ask for QA so that we don't accumulate possible bugs and the future feature flag removal is easier for everyone.

[]
[:<>
[quo/page-nav
{:key :header
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering if we really need to provide key

Comment on lines -7 to +13
:flex 1
:align-items :flex-start}))

(def index
{:margin-left 5})

(def text-container
{:margin-left 8
:flex 1})
{:margin-left 8})
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we modified the markdown-list component, are we checking the UI isn't broken in other screens where it is used?

@@ -10,10 +10,15 @@

(defonce ^:private active-listeners (atom []))
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering why do we use a global atom to track the state. I know this was already here, but I think this could live in re-frame 🤔

Comment on lines +30 to +32
:on-press #(rf/dispatch [:show-bottom-sheet
{:theme :dark
:content (fn [] [sheets.migrate/view])}])}]]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the. value for :content is already a function, so we don't need to wrap it into another one, i.e. we can directly pass sheets.migrate/view

Comment on lines 57 to +59
(rf/reg-event-fx :keycard/on-action-with-pin-error
(fn [{:keys [db]} [error]]
(log/debug "[keycard] get keys error: " error)
(log/debug "[keycard] on-action-with-pin-error: " error)
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK we have an event to log errors, so we can use it

Comment on lines -21 to +28
"Ready to Scan"]
(i18n/label :t/ready-to-scan)]
[rn/image
{:source (resources/get-image :nfc-prompt)}]
[rn/text {:style {:font-size 16 :color :white :margin-vertical 36}}
(if connected?
"Connected. Don’t move your card."
"Hold your phone near a Status Keycard")]
(i18n/label :t/connected-dont-move)
(i18n/label :t/hold-phone-near-keycard))]
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Comment on lines +21 to +22
[quo/text {}
(i18n/label :t/migrate-key-pair-keycard-default-key {:name profile-name})]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can avoid this empty map

Comment on lines +23 to +26
:on-success
#(do
(rf/dispatch [:keycard/disconnect])
(rf/dispatch
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are modifying this code, we could change #(do ...) -> (fn [] ...)

@flexsurfer
Copy link
Member Author

thanks @ulisesmac, all the information is in the task itself, there is no need to duplicate it in the PR, it's not worth it to waste time on each PR, it is better to test the final result with full functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Keycard - Allow user to initiate Profile key pair migration on an empty Keycard
4 participants