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

Standardized in-app authentication #16916

Merged
merged 5 commits into from
Sep 28, 2023
Merged

Standardized in-app authentication #16916

merged 5 commits into from
Sep 28, 2023

Conversation

siddarthkay
Copy link
Contributor

@siddarthkay siddarthkay commented Aug 8, 2023

fixes #15570

Designs: https://www.figma.com/file/V6nlpAWIf2e1XU8RJ9yQPe/Syncing-for-Mobile?type=design&node-id=1144-131149&mode=design&t=PDU0zL2HgIjUkEwX-0

Other use Designs: https://www.figma.com/file/HKncH4wnDwZDAhc4AryK8Y/Wallet-for-Mobile?type=design&node-id=1741-374592&mode=design&t=4WPq9m1hep9SXcv3-0

this PR was started by an external contributor, now maintained by @J-Son89

Summary

Adds Standardised In App authentication and uses this in Syncing Flows.

Caveats - the design for this is not 100% correct as the Slide Button is missing some variants and so a follow up issue will be created to implement this and update the designs.

I would consider this pr there to add the functionality mostly and design is 90% complete and will be finished in follow up issues as the changes go beyond the scope of this pr as they are related to issues with individual design system components.

Steps to test

  • Open Status
  • Navigate to Syncing > Slide to reveal > Enter Password

@status-im-auto
Copy link
Member

status-im-auto commented Aug 8, 2023

Jenkins Builds

Click to see older builds (80)
Commit #️⃣ Finished (UTC) Duration Platform Result
574e720 #1 2023-08-08 06:10:19 ~41 sec android-e2e 📄log
574e720 #1 2023-08-08 06:10:21 ~43 sec android 📄log
574e720 #1 2023-08-08 06:10:29 ~51 sec ios 📄log
574e720 #1 2023-08-08 06:12:24 ~2 min tests 📄log
df77cbf #2 2023-08-08 13:58:16 ~29 sec android-e2e 📄log
df77cbf #2 2023-08-08 13:58:28 ~41 sec android 📄log
df77cbf #2 2023-08-08 14:00:34 ~2 min tests 📄log
df77cbf #2 2023-08-08 14:00:47 ~2 min ios 📄log
ee587a2 #3 2023-08-14 10:15:05 ~26 sec android 📄log
ee587a2 #3 2023-08-14 10:15:11 ~26 sec ios 📄log
ee587a2 #3 2023-08-14 10:15:27 ~48 sec android-e2e 📄log
ee587a2 #3 2023-08-14 10:17:20 ~2 min tests 📄log
✔️ bc834e3 #4 2023-08-15 11:02:05 ~5 min android 🤖apk 📲
✔️ bc834e3 #4 2023-08-15 11:03:11 ~6 min ios 📱ipa 📲
✔️ bc834e3 #4 2023-08-15 11:05:41 ~9 min android-e2e 🤖apk 📲
bc834e3 #4 2023-08-15 11:06:17 ~9 min tests 📄log
89e20fa #5 2023-08-15 11:21:03 ~3 min tests 📄log
✔️ 89e20fa #5 2023-08-15 11:23:13 ~5 min android 🤖apk 📲
✔️ 89e20fa #5 2023-08-15 11:23:22 ~5 min android-e2e 🤖apk 📲
✔️ 89e20fa #5 2023-08-15 11:24:24 ~6 min ios 📱ipa 📲
3ab5de2 #6 2023-08-15 13:17:41 ~3 min tests 📄log
✔️ 3ab5de2 #6 2023-08-15 13:20:02 ~6 min android 🤖apk 📲
✔️ 3ab5de2 #6 2023-08-15 13:20:32 ~6 min android-e2e 🤖apk 📲
✔️ 3ab5de2 #6 2023-08-15 13:35:11 ~21 min ios 📱ipa 📲
f9f3a7f #7 2023-08-18 14:03:56 ~2 min tests 📄log
✔️ f9f3a7f #7 2023-08-18 14:06:59 ~5 min android-e2e 🤖apk 📲
✔️ f9f3a7f #7 2023-08-18 14:08:26 ~7 min ios 📱ipa 📲
✔️ f9f3a7f #7 2023-08-18 14:09:19 ~8 min android 🤖apk 📲
679f062 #8 2023-08-22 13:25:06 ~3 min tests 📄log
✔️ 679f062 #8 2023-08-22 13:27:38 ~5 min android-e2e 🤖apk 📲
✔️ 679f062 #8 2023-08-22 13:27:45 ~5 min android 🤖apk 📲
✔️ 679f062 #8 2023-08-22 13:29:13 ~7 min ios 📱ipa 📲
50625c5 #9 2023-08-22 13:57:25 ~2 min tests 📄log
✔️ 50625c5 #9 2023-08-22 14:01:33 ~6 min android-e2e 🤖apk 📲
✔️ 50625c5 #9 2023-08-22 14:01:38 ~6 min android 🤖apk 📲
✔️ 50625c5 #9 2023-08-22 14:02:07 ~6 min ios 📱ipa 📲
✔️ fcbcc52 #10 2023-08-29 11:21:39 ~5 min android 🤖apk 📲
✔️ fcbcc52 #10 2023-08-29 11:23:44 ~7 min android-e2e 🤖apk 📲
✔️ fcbcc52 #10 2023-08-29 11:23:46 ~7 min ios 📱ipa 📲
✔️ fcbcc52 #10 2023-08-29 11:25:07 ~9 min tests 📄log
03670c0 #11 2023-08-31 10:11:22 ~2 min tests 📄log
✔️ 03670c0 #11 2023-08-31 10:14:19 ~5 min android 🤖apk 📲
✔️ 03670c0 #11 2023-08-31 10:14:26 ~5 min android-e2e 🤖apk 📲
✔️ 03670c0 #11 2023-08-31 10:16:33 ~7 min ios 📱ipa 📲
f092182 #12 2023-09-05 22:33:19 ~2 min tests 📄log
✔️ f092182 #12 2023-09-05 22:36:20 ~5 min android-e2e 🤖apk 📲
✔️ f092182 #12 2023-09-05 22:37:00 ~6 min android 🤖apk 📲
✔️ f092182 #12 2023-09-05 22:41:43 ~11 min ios 📱ipa 📲
e37f7c5 #13 2023-09-06 12:22:22 ~4 min tests 📄log
✔️ e37f7c5 #13 2023-09-06 12:23:28 ~5 min android-e2e 🤖apk 📲
✔️ e37f7c5 #13 2023-09-06 12:24:49 ~7 min android 🤖apk 📲
✔️ e37f7c5 #13 2023-09-06 12:35:04 ~17 min ios 📱ipa 📲
✔️ 77ba9e2 #14 2023-09-07 22:45:40 ~6 min android 🤖apk 📲
✔️ 77ba9e2 #14 2023-09-07 22:45:41 ~6 min android-e2e 🤖apk 📲
✔️ 77ba9e2 #14 2023-09-07 22:47:55 ~8 min tests 📄log
✔️ 77ba9e2 #14 2023-09-07 22:51:23 ~12 min ios 📱ipa 📲
✔️ 587686d #15 2023-09-13 10:31:34 ~6 min android-e2e 🤖apk 📲
✔️ 587686d #15 2023-09-13 10:31:37 ~6 min android 🤖apk 📲
✔️ 587686d #15 2023-09-13 10:33:37 ~8 min tests 📄log
✔️ 587686d #15 2023-09-13 10:40:26 ~15 min ios 📱ipa 📲
4918165 #16 2023-09-14 14:02:46 ~2 min tests 📄log
✔️ 4918165 #16 2023-09-14 14:06:52 ~6 min android-e2e 🤖apk 📲
✔️ 4918165 #16 2023-09-14 14:06:55 ~6 min android 🤖apk 📲
✔️ 4918165 #16 2023-09-14 14:07:57 ~7 min ios 📱ipa 📲
✔️ 7ca769e #17 2023-09-19 16:50:26 ~5 min android 🤖apk 📲
✔️ 7ca769e #17 2023-09-19 16:51:32 ~6 min ios 📱ipa 📲
✔️ 7ca769e #17 2023-09-19 16:53:47 ~9 min android-e2e 🤖apk 📲
✔️ 7ca769e #17 2023-09-19 16:53:49 ~9 min tests 📄log
e01be7c #18 2023-09-20 14:16:25 ~2 min tests 📄log
✔️ e01be7c #18 2023-09-20 14:20:08 ~6 min android-e2e 🤖apk 📲
✔️ e01be7c #18 2023-09-20 14:20:13 ~6 min android 🤖apk 📲
✔️ e01be7c #18 2023-09-20 14:21:19 ~7 min ios 📱ipa 📲
✔️ 5f2479e #19 2023-09-21 07:42:35 ~6 min android-e2e 🤖apk 📲
✔️ 5f2479e #19 2023-09-21 07:42:36 ~6 min android 🤖apk 📲
✔️ 5f2479e #19 2023-09-21 07:42:44 ~6 min ios 📱ipa 📲
✔️ 5f2479e #19 2023-09-21 07:49:11 ~12 min tests 📄log
✔️ a03b4e3 #20 2023-09-21 13:16:37 ~6 min android 🤖apk 📲
✔️ a03b4e3 #20 2023-09-21 13:16:59 ~7 min android-e2e 🤖apk 📲
✔️ a03b4e3 #20 2023-09-21 13:19:03 ~9 min tests 📄log
✔️ a03b4e3 #20 2023-09-21 13:20:21 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
e9d4a83 #21 2023-09-28 08:57:13 ~2 min tests 📄log
✔️ e9d4a83 #21 2023-09-28 09:00:11 ~5 min android-e2e 🤖apk 📲
✔️ e9d4a83 #21 2023-09-28 09:00:23 ~5 min android 🤖apk 📲
✔️ e9d4a83 #21 2023-09-28 09:01:10 ~6 min ios 📱ipa 📲
✔️ 8bf40f8 #22 2023-09-28 09:07:53 ~6 min android-e2e 🤖apk 📲
✔️ 8bf40f8 #22 2023-09-28 09:07:56 ~6 min android 🤖apk 📲
✔️ 8bf40f8 #22 2023-09-28 09:08:17 ~6 min ios 📱ipa 📲
✔️ 8bf40f8 #22 2023-09-28 09:10:23 ~8 min tests 📄log

@@ -87,12 +87,6 @@
small-height (:track-height constants/small-dimensions)]
(h/has-style mock {:height small-height})))

(h/test "render with the correct customization-color"
Copy link
Contributor

Choose a reason for hiding this comment

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

testing styles is brittle, in my opinion it will be better to add unit tests on the custom color functionality directly rather than on components using it.
I will look to add this in a separate set of work

Copy link
Contributor

@ajayesivan ajayesivan left a comment

Choose a reason for hiding this comment

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

Apart from the formatting and linting issues, the code seems good to me.

Comment on lines 26 to 27

})
Copy link
Contributor

Choose a reason for hiding this comment

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

Move the closing brackets to line 25

{:margin-top 12
:background-color colors/white-opa-5
:border-radius 20
:flex 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting

[qr-code-viewer/qr-code-view 331 @code]
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Move the closing brackets to previous line

Comment on lines 131 to 135
:fallback-button-label (i18n/label :t/reveal-sync-code)}]])
]

]

Copy link
Contributor

Choose a reason for hiding this comment

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

Brackets;

"Options
- `on-complete` Callback called when the sliding is complete
- `disabled?` Boolean that disables the button
(_and gestures_)
- `size` `:small`/`:large`
- `size` `40`/`48`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why moving away from :small :large?
Also I would not be passing around 40/48, they look a lot like magic numbers (I am personally against passing keywords as well, I'd const everything so there's some safety), but especially with numbers, I'd const them somewhere (withing the component itself makes sense, since if you are using the component, you are requiring that namespace), but that's a larger discussion I take, maybe @J-Son89 @ilmotta @erikseppanen @flexsurfer have an opinion? (apologies if it's been discussed already)

TLDR:
[slidebutton.view/view {:size 40}] vs [slidebutton/view {:size slidebutton/size-small} (or slidebutton/size-40)
(I am for the latter, which is what we do for colors etc)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @cammellos, I believe this is still an open discussion. I agree with you here and like this suggestion the most 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

@cammellos, this is a recurring discussion in PRs.

My opinion has always been that magical design values should be avoided. Tomorrow a designer can change their mind and then we'd need to go through an error-prone process to update all magical values. Sometimes, these magical values also hurt readability because the developer needs to constantly memorize whatever they mean.

The deeper discussion to me is related to using semantic values versus magical values. For example, we're full of 50 and 60 numbers in the code, colors are hardcoded willy-nilly, shadows too use numbers, and so on. One argument in favor of using magical design values is that they eliminate this translation layer between code and Figma, which can help reduce UI bugs.

The code is also a symptom of the way designers use Figma. I've once integrated with a design system that avoided magical values like the plague, and that in turn positively translated to the code. I don't believe our design team will be able to make such drastic changes in Figma, so realistically, it'll be probably up to us to change the code independently.

No discussion oriented towards achieving consensus has been done in our team, I guess it's about time :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I think this could do with some finalised decision. There could also be a set of sizes in figma foundations similar to typography etc so using :small :medium are consistent across components and designs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also would vote for using keywords/constants instead of numbers. More up for keywords (:size-40) to have a finite list of options when using within cond.

cc @ulisesmac, since we had a similar discussion regarding size for context tags component

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll set up a vote in the mobile discord and we can record the decision

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated to use: :size/s-40 and :size/s-48

[utils.security.core :as security]
[status-im2.common.standard-authentication.enter-password.style :as style]
[quo2.theme :as quo.theme]))

Copy link
Contributor

Choose a reason for hiding this comment

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

Few extra lines here.

Copy link
Contributor

Choose a reason for hiding this comment

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

👁️


(defn- view-internal
[{:keys [theme on-enter-password button-label]}]
(let [entered-password (atom "")
Copy link
Contributor

@ilmotta ilmotta Aug 17, 2023

Choose a reason for hiding this comment

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

This atom should be defined outside the Reagent renderer.

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, I'm a bit confused what you mean here. Could you clarify with a code snippet example? 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Jamie, Icaro wants to say that this atom will be recreated on each rerender since this is in the render function. To put it outside of it, just use a form-2 component:

(defn view [initial-props]
  (let [your-atom (atom "")] ; outside render fn
    (fn [props] ; this is the render function
      [:<>] ; hiccup code
    )
  ))

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks!

:icon :i/info}
error]
[rn/pressable
{:active-opacity 1
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this prop active-opacity? It seems to be a leftover of the Touchable API.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, seems I missed some pieces on this pr. It was an external candidates initially - will remove 👍

:error? (seq error)
:accessibility-label :password-input
:label (i18n/label :t/profile-password)
:on-change-text (fn [password]
Copy link
Contributor

Choose a reason for hiding this comment

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

This function argument is shadowing the binding password. It's a bit dangerous/easy to introduce a bug. The on-change-text function can actually be defined outside the renderer, in the form-2 let because the function only relies on entered-password.

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, I'll change to user-password or something like that 👍

Copy link
Contributor

@J-Son89 J-Son89 Aug 18, 2023

Choose a reason for hiding this comment

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

actually, I've noticed that this input is also used on initial login page? I will extract these pieces out into a common connected component and see if I can address this in both places

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, thanks @J-Son89

Copy link
Contributor

Choose a reason for hiding this comment

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

this is done now 👍

:placeholder (i18n/label :t/type-your-password)
:auto-focus true
:show-cancel false
:error? (seq error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Slight improvement: seq returns a sequence, which is more expensive to diff than a boolean and will affect reagent's ability to optimize quo/input. So when passing props to components that expect booleans, it's almost always better to pass a true boolean type. It's obviously fine to use seq in lots of other places, my comment is specifically about passing boolean props to components.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

(on-auth-success)
(js/console.log "response" response))
:on-fail (fn [error]
(js/console.log "Authentication Failed. 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.

console.log should be replaced by our logging library.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is timbre, right? will adjust 👍

on-auth-fail
size
theme]
:or {on-auth-success #() on-auth-fail #()}}]
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit weird to define empty anonymous functions like this. This might be a sign that the code using these functions in authorize is not checking for function existence, which is usually recommended, otherwise it's too easy to have an exception.

In the authorize function, we can change it to check the callback functions exist before calling them. The pattern is (when on-auth-success (on-auth-success)). Also, the default destructuring doesn't protect the code from the caller of view explicitly passing nil as the calllback (which can be surprisingly easy to happen in Clojure).

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, I agree. will sort 👍

:or {on-auth-success #() on-auth-fail #()}}]
(let [reset-slider? (reagent/atom false)
on-close #(reset! reset-slider? true)]
(fn []
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to define the renderer arguments here, otherwise if they change the component won't re-render.

(reset! code connection-string)))
clock (fn []
(if (pos? (- code-valid-for-ms
(- (* 1000 (js/Math.ceil (/ (datetime/timestamp) 1000)))
Copy link
Contributor

Choose a reason for hiding this comment

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

This repeated rounding mechanism in the code should ideally be in utils.number. You can try the utils.number/naive-round and see if it helps. The rounding mechanism is different, but you can round up to a certain number of decimal places too. The code would look like (utils.number/naive-round (datetime/timestamp) 3)

Copy link
Contributor

Choose a reason for hiding this comment

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

I will take a look, but slightly outside the scope of this pr as this code was there from before, albeit I am the one who added it 🙃

(rf/dispatch [:set-in [:profile/login :key-uid] key-uid])
(rf/dispatch
[:syncing/get-connection-string-for-bootstrapping-another-device
password set-code]))]
(fn []
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

but the outer function here also has no params? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2023-08-18 at 11 50 27

Copy link
Contributor

Choose a reason for hiding this comment

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

You are 100% correct. My bad :)

(on-valid-connection-string response)
(rf/dispatch [:syncing/update-role constants/local-pairing-role-sender])
(rf/dispatch [:hide-bottom-sheet]))
{:db (update db
Copy link
Contributor

Choose a reason for hiding this comment

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

@ilmotta @cammellos I am trying to get the error message show on the input when the user puts in a wrong password.

in the case of syncing setup this seems to be the right place but this approach isn't working.
Any thoughts how I can/should do this? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

this is all handled now 👍

@@ -0,0 +1,6 @@
(ns status-im2.common.standard-authentication.forgot-password-doc.style)

(def forget-password-doc-container {:margin-right 16})
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't make sense, the name is longer than the style map itself, forget-password is redundant in the name, and by guidelines it's allowed to still have short styles in the view

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, I just copied this code over. These long names are a symptom that the code should have been initially in its own namespace. Anyway, you're right, I will adjust it 👌

@J-Son89 J-Son89 force-pushed the standard-auth-process branch 2 times, most recently from 679f062 to 50625c5 Compare August 22, 2023 13:55
@J-Son89 J-Son89 requested a review from ilmotta August 22, 2023 13:55
@flexsurfer flexsurfer changed the title [IMPORTED] Standardized in-app authentication Standardized in-app authentication Aug 24, 2023
Comment on lines +7 to +52
(defn view
[{:keys [shell?]}]
[quo/documentation-drawers
{:title (i18n/label :t/forgot-your-password-info-title)
:shell? shell?}
[rn/view
{:style style/container}
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-description)]

[rn/view {:style style/step-container}
[quo/step {:in-blur-view? shell?} 1]
[rn/view
{:style style/step-content}
[quo/text {:size :paragraph-2 :weight :semi-bold}
(i18n/label :t/forgot-your-password-info-remove-app)]
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-remove-app-description)]]]

[rn/view {:style style/step-container}
[quo/step {:in-blur-view? shell?} 2]
[rn/view
{:style style/step-content}
[quo/text {:size :paragraph-2 :weight :semi-bold}
(i18n/label :t/forgot-your-password-info-reinstall-app)]
[quo/text {:size :paragraph-2}
(i18n/label :t/forgot-your-password-info-reinstall-app-description)]]]

[rn/view {:style style/step-container}
[quo/step {:in-blur-view? shell?} 3]
[rn/view
{:style style/step-content}
[rn/view
{:style style/step-title}
[quo/text {:size :paragraph-2} (str (i18n/label :t/sign-up) " ")]
[quo/text {:size :paragraph-2 :weight :semi-bold}
(i18n/label :t/forgot-your-password-info-signup-with-key)]]
[quo/text {:size :paragraph-2}
(i18n/label :t/forgot-your-password-info-signup-with-key-description)]]]

[rn/view {:style style/step-container}
[quo/step {:in-blur-view? shell?} 4]
[rn/view
{:style style/step-content}
[quo/text {:size :paragraph-2 :weight :semi-bold}
(i18n/label :t/forgot-your-password-info-create-new-password)]
[quo/text {:size :paragraph-2}
(i18n/label :t/forgot-your-password-info-create-new-password-description)]]]]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we break up this component a little? Also I see some repeated code style/step-container is repeated 4 times. Probably can be extracted to a one defined component

Copy link
Contributor

Choose a reason for hiding this comment

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

I just moved this code to a common location. The main focus of this pr is to enable a standard authentication process in the pr. I am happy to make adjustments but would prefer for pieces like this to do in a follow up.

:size :default
:icon :i/info}
error-message]
[rn/touchable-opacity
Copy link
Contributor

Choose a reason for hiding this comment

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

rn/pressable

Comment on lines 46 to 50
set-code (fn [connection-string]
(when (sync-utils/valid-connection-string? connection-string)
(reset! timestamp (* 1000
(js/Math.ceil (/ (datetime/timestamp)
1000))))
(reset! delay 1000)
(reset! code connection-string)))
clock (fn []
(if (pos? (- code-valid-for-ms
(- (* 1000
(js/Math.ceil (/ (datetime/timestamp) 1000)))
@timestamp)))
(swap! valid-for-ms (fn [_]
(- code-valid-for-ms
(- (* 1000
(js/Math.ceil
(/ (datetime/timestamp) 1000)))
@timestamp))))
(reset! delay nil)))
Copy link
Contributor

@OmarBasem OmarBasem Aug 24, 2023

Choose a reason for hiding this comment

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

This part is hard to read and understand. Maybe extract to utils file and break it up into smaller functions if possible

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, this was previously here so I will create a follow up to address this. Also it seems this code will be better as being dispatched as it will break the need for so many nested callbacks

:track-text (i18n/label :t/slide-to-reveal-code)
:customization-color customization-color
:on-enter-password on-enter-password
:biometric-auth? false
Copy link
Member

Choose a reason for hiding this comment

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

Quick question: Do we support biometric authentication?

Copy link
Contributor

@J-Son89 J-Son89 Aug 28, 2023

Choose a reason for hiding this comment

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

not yet, but we will! :) (at least for standardized auth anyway)

Comment on lines 186 to 198
(rf/defn verify-database-password
{:events [:profile.login/verify-database-password]}
[{:keys [db] :as cofx} entered-password]
(let [hashed-password (-> entered-password
security/safe-unmask-data
ethereum/sha3)
key-uid (get-in db [:profile/login :key-uid])
valid? (native-module/verify-database-password
key-uid
hashed-password
(fn [response]
(let [valid? (string/blank? (.-error (js/JSON.parse response)))]
(rf/dispatch [:profile.login/verified-database-password valid?]))))]))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(rf/defn verify-database-password
{:events [:profile.login/verify-database-password]}
[{:keys [db] :as cofx} entered-password]
(let [hashed-password (-> entered-password
security/safe-unmask-data
ethereum/sha3)
key-uid (get-in db [:profile/login :key-uid])
valid? (native-module/verify-database-password
key-uid
hashed-password
(fn [response]
(let [valid? (string/blank? (.-error (js/JSON.parse response)))]
(rf/dispatch [:profile.login/verified-database-password valid?]))))]))
(rf/defn verify-database-password
{:events [:profile.login/verify-database-password]}
[{:keys [db]} entered-password]
(let [hashed-password (-> entered-password
security/safe-unmask-data
ethereum/sha3)
key-uid (get-in db [:profile/login :key-uid])
callback (fn [response]
(let [valid? (string/blank? (.-error (js/JSON.parse response)))]
(rf/dispatch [:profile.login/verified-database-password valid?])))]
(native-module/verify-database-password
key-uid
hashed-password
callback)))

Copy link
Contributor

Choose a reason for hiding this comment

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

will adjust, thanks @smohamedjavid!

:profile/login
#(-> %
(dissoc :processing)
(assoc :error "Invalid password")))}))
Copy link
Member

Choose a reason for hiding this comment

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

I believe we should use (i18n/label :t/oops-wrong-password)

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, I can make that adjustment. This is just the error message passed to the db here. There is some weird hack on the display of actually showing that. Actually I wonder are we okay with adding i18n messages to the db? @cammellos is this okay for us or should we keep it english only in the db? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Just raised that comment from a UX standpoint. Because we can't display English if a user uses the app in a different language. 👍

(There are quite a few usages of i18n in reframe event handlers in our codebase. Not sure if it's allowed)

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, this is currently how the password error message is working 😶

(defn get-error-message
[error]
(if (and (some? error)
(or (= error "file is not a database")
(string/starts-with? error "failed to set ")
(string/starts-with? error "Failed")))
(i18n/label :t/oops-wrong-password)
error))

I just moved that code but I believe this should have a stronger mechanism - and I think better as you are saying the error message ideally is just set appropriately where the error originates.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the best is to treat the translated text as part of the view layer, and the translation keys the data that can be persisted in the app db. This way, the db layer stays translation agnostic. Not a big deal though, but seems better, also facilitates unit testing.

Comment on lines 46 to 47


Copy link
Member

Choose a reason for hiding this comment

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

Extra line

@@ -82,17 +81,11 @@
(h/has-style track-mock {:opacity constants/disable-opacity})))

(h/test "render the small button"
(h/render [slide-button/view (assoc default-props :size :small)])
(h/render [slide-button/view (assoc default-props :size :size/s-40)])
Copy link
Contributor

Choose a reason for hiding this comment

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

@J-Son89, quick question, is the decision to use a qualified key to describe sizes captured somewhere in our guidelines? Or is this just a single example and there's no clear recommendation yet?

Copy link
Contributor

Choose a reason for hiding this comment

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

the decision was agreed upon within internal communications channels. It should be added to the docs. I guess we wanted to use it once or twice to make sure we have it right before adding it to the docs. I'll see if someone can add it (if not I will 👍 )
btw, Ulises made a good point and I was curious of the difference, why not :size-40 instead of :size/s-40? does the / really give us some benefit?

:icon-left :i/reveal
:disabled? (or (not sign-in-enabled?) processing)
:on-press (fn []
(rf/dispatch [:set-in [:profile/login :key-uid] key-uid])
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a story...

I've seen this set-in pattern in more than one re-frame project as a way of helping reduce re-frame boilerplate. Numerous times I've seen it causing UI glitches because the UI would dispatch multiple set-in events in succession and they would end up in different rendering batches in the re-frame queue. The more reliable solution is to mutate the app db alongside other effects in the same event handler, like an atomic operation.

The re-frame docs explicitly tell us re-frame can't guarantee the order of events between different dispatches, so this is also another problem of using this set-in pattern, some devs will incorrectly assume the setter happens first.

The set-in pattern also tends to couple the UI with the app db shape because the UI now needs to know how the data is structured behind the scenes. Some re-frame projects even go as far as using a get-in subscription, as yet again, a way to make accessing the app db more convenient from the UI. And things don't end there, some projects create other "wrapper events" around the core app db atom, like assoc-in, update-in, and so on. All bad for maintainability in my experience.

End of story :)

FYI: @ulisesmac, @cammellos, @flexsurfer, @erikseppanen, @smohamedjavid, @J-Son89

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @ilmotta, if there is some guidance on what is best to do I will be happy to implement. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel this is part of a much bigger discussion and it would be good if we could organise some initiative to address this and agree on solid and consistent approach 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

At this stage I just wanted to raise awareness @J-Son89 and I agree with you, it's not something for your PR alone to change or decide.

The following is a known post about some patterns seen in re-frame apps. Note that some ideas existed in redux apps before re-frame was a thing, so maybe finding guidance on redux can be more fruitful.

https://vvvvalvalval.github.io/posts/some-re-frame-patterns-for-composability.html#generic_subscriptions_and_events_for_app-db_paths

Copy link
Member

@flexsurfer flexsurfer Aug 29, 2023

Choose a reason for hiding this comment

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

yes :set-in is a legacy code, we even have TODO

;;TODO :replace by named events
(rf/defn set-event
  {:events [:set]}
  [{:keys [db]} k v]
  {:db (assoc db k v)})

;;TODO :replace by named events
(rf/defn set-once-event
  {:events [:set-once]}
  [{:keys [db]} k v]
  (when-not (get db k)
    {:db (assoc db k v)}))

;;TODO :replace by named events
(rf/defn set-in-event
  {:events [:set-in]}
  [{:keys [db]} path v]
  {:db (assoc-in db path v)})

but it should be more visible i guess, so devs won't use it

@pavloburykh
Copy link
Contributor

@J-Son89 @qfrank could please someone resolve conflicts in src/status_im2/contexts/syncing/events.cljs and rebase the PR? After that we will be ready for re-testing. Thank you!

@qfrank
Copy link
Contributor

qfrank commented Sep 21, 2023

@J-Son89 @qfrank could please someone resolve conflicts in src/status_im2/contexts/syncing/events.cljs and rebase the PR? After that we will be ready for re-testing. Thank you!

done @pavloburykh

@status-im-auto
Copy link
Member

77% of end-end tests have passed

Total executed tests: 43
Failed tests: 10
Passed tests: 33
IDs of failed tests: 702894,703086,702786,702731,702808,702846,702783,702784,702732,703503 

Failed tests (10)

Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:442: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline
    



    Device sessions

    2. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894

    Device 1: Click until ChatMessageInput by accessibility id: chat-message-input will be presented
    Device 1: Looking for a message by text: Hurray! unblocked

    critical/test_public_chat_browsing.py:967: in test_community_contact_block_unblock_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Hurray! unblocked was not received in public chat after user unblock! 
    

    [[Message can be missed after unblock: https://github.com//issues/16873]]

    Device sessions

    2. test_community_mark_all_messages_as_read, id: 703086

    Device 1: Tap on found: Button
    Device 1: Click until Text by accessibility id: community-description-text will be presented

    critical/test_public_chat_browsing.py:1028: in test_community_mark_all_messages_as_read
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     New messages counter is not shown in home > Community element
    E    New messages counter is not shown in community channel element
    



    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_mentions_push_notification, id: 702786

    # STEP: Invited member gets push notification with the mention and tap it
    Device 2: Getting PN by 'user_2'

    critical/test_public_chat_browsing.py:1149: in test_community_mentions_push_notification
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification with the mention was not received by admin
    E    Can not edit a message with a mention
    E    Push notification with the mention was not received by the invited member 
    

    [[Issue with username in PN, issue #6 in 15500]]

    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    Device 2: Find Text by xpath: //*[starts-with(@text,'test message')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_1_1_public_chats.py:1416: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not changed to Delivered, it's Sent after back up online!
    



    Device sessions

    2. test_1_1_chat_delete_via_long_press_relogin, id: 702784

    ## Sign in (password:qwerty1234, keycard:False)
    Device 2: Find EditBox by accessibility id: password-input

    critical/chats/test_1_1_public_chats.py:1468: in test_1_1_chat_delete_via_long_press_relogin
        self.home_2.reopen_app()
    ../views/base_view.py:651: in reopen_app
        sign_in_view.sign_in(password)
    ../views/sign_in_view.py:296: in sign_in
        self.password_input.send_keys(password)
    ../views/base_element.py:367: in send_keys
        self.find_element().send_keys(value)
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: EditBox by accessibility id: `password-input` 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
    



    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_navigate_to_channel_when_relaunch, id: 702846

    ## Signed in successfully!
    Device 1: Looking for a message by text: some_text

    critical/test_public_chat_browsing.py:355: in test_community_navigate_to_channel_when_relaunch
        self.drivers[0].fail("Not navigated to channel view after reopening app")
    base_test_case.py:179: in fail
        pytest.fail('Device %s: %s' % (self.number, text))
     Device 1: Not navigated to channel view after reopening app
    



    Device sessions

    2. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] https://github.com//issues/17175]]

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Passed tests (33)

    Click to expand

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    3. test_community_unread_messages_badge, id: 702841
    Device sessions

    4. test_community_message_delete, id: 702839
    Device sessions

    5. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    6. test_community_one_image_send_reply, id: 702859
    Device sessions

    7. test_community_message_edit, id: 702843
    Device sessions

    8. test_community_several_images_send_reply, id: 703194
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    4. test_group_chat_mute_chat, id: 703495
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_leave, id: 702845
    Device sessions

    2. test_community_markdown_support, id: 702809
    Device sessions

    3. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_edit_message, id: 702855
    Device sessions

    2. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    5. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    6. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    7. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    Thank you for your work @J-Son89 @qfrank! PR is ready for design review.

    NOTE for design review:

    The following issues are know and will be fixed in separately:

    ISSUE 1 Biometric auth is not implemented

    comment form @J-Son89

    I should have specified in the description of this pr, but the original scope of this pr was only handling the password authentication variant. Ideally we will complete biometric auth in a separate issue. wdyt?

    ISSUE 2 Biometric icon appears when sliding to the end

    comment form @J-Son89

    This is an issue with the slider button component and ideally we can do in an isolate pr. Also the slider button is missing some variants which should be used here so I can create one big issue to adjust/update the button appropriately.

    ISSUE 3 Placeholder text partially remains visible for a moment behind the slider

    comment form @J-Son89

    same as issue 2.

    Copy link

    @Francesca-G Francesca-G left a comment

    Choose a reason for hiding this comment

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

    Here's the design review :)

    @status-im-auto
    Copy link
    Member

    49% of end-end tests have passed

    Total executed tests: 43
    Failed tests: 22
    Passed tests: 21
    
    IDs of failed tests: 702782,702733,703194,702859,702732,703133,702840,703086,702948,702894,702783,703503,702855,703391,702786,702839,702838,702844,702843,702731,702808,702841 
    

    Failed tests (22)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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_community_one_image_send_reply, id: 702859

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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_community_emoji_send_copy_paste_reply, id: 702840

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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_community_mark_all_messages_as_read, id: 703086

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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_community_contact_block_unblock_offline, id: 702894

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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 
    

    [[Message can be missed after unblock: https://github.com//issues/16873]]

    6. test_community_message_delete, id: 702839

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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
    



    7. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Looking for a message by text: open community
    Device 2: Find BaseElement by xpath: //*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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
    



    Device sessions

    8. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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
    



    9. test_community_message_edit, id: 702843

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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
    



    10. test_community_unread_messages_badge, id: 702841

    Test setup failed: critical/test_public_chat_browsing.py:596: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` 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
    



    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    2. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:443: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948

    Device 2: Joining community
    Device 2: Find Button by accessibility id: show-request-to-join-screen-button

    critical/test_public_chat_browsing.py:1250: in test_community_hashtag_links_to_community_channels
        self.community_2.join_community(open_community=False)
    ../views/chat_view.py:418: in join_community
        self.join_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: Button by accessibility id: `show-request-to-join-screen-button` 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
    



    Device sessions

    2. test_community_mentions_push_notification, id: 702786

    # STEP: Invited member gets push notification with the mention and tap it
    Device 2: Getting PN by 'user_2'

    critical/test_public_chat_browsing.py:1166: in test_community_mentions_push_notification
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification with the mention was not received by admin
    E    Can not edit a message with a mention
    E    Push notification with the mention was not received by the invited member 
    

    [[Issue with username in PN, https://github.com//issues/17396]]

    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    # STEP: Check that can remove user from logged out state
    Device 1: Find Button by accessibility id: show-profiles

    critical/test_public_chat_browsing.py:536: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.sign_in.show_profiles_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `show-profiles` 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
    



    Device sessions

    2. test_community_discovery, id: 703503

    Device 1: Tap on found: Button
    Device 1: Swiping up

    critical/test_public_chat_browsing.py:359: in test_community_discovery
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Element show-request-to-join-screen-button is different from expected template discovery_join_button.png! 
    

    [[Request to Join Community button color issue: https://github.com//issues/17295]]

    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782

    Device 2: Find OpenInStatusButton by xpath: //*[@text="Open in Status"]
    Device 2: Tap on found: OpenInStatusButton

    critical/chats/test_1_1_public_chats.py:990: in test_1_1_chat_emoji_send_reply_and_open_link
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message with emoji was not sent or received in 1-1 chat
    E    No reply received in 1-1 chat
    



    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Find Button by accessibility id: jump-to

    critical/chats/test_1_1_public_chats.py:1272: in test_1_1_chat_text_message_delete_push_disappear
        self.chat_2.jump_to_card_by_text(self.username_1)
    ../views/base_view.py:642: in jump_to_card_by_text
        self.click_on_floating_jump_to()
    ../views/base_view.py:631: in click_on_floating_jump_to
        self.jump_to_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: Button by accessibility id: `jump-to` 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
    



    Device sessions

    3. test_1_1_chat_edit_message, id: 702855

    Device 2: Find Text by xpath: //*[starts-with(@text,'Message before edit 1-1')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_1_1_public_chats.py:1192: in test_1_1_chat_edit_message
        self.chat_2.chat_element_by_text(message_before_edit_1_1).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:235: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's Sent
    



    Device sessions

    4. test_1_1_chat_send_image_save_and_share, id: 703391

    Device 2: Tap on found: Button
    Device 2: Find BaseElement by accessibility id: toast-content

    critical/chats/test_1_1_public_chats.py:1249: in test_1_1_chat_send_image_save_and_share
        toast_element_text = toast_element.text
    ../views/base_element.py:228: in text
        return self.find_element().text
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:90: in text
        return self._execute(Command.GET_ELEMENT_TEXT)["value"]
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:395: in _execute
        return self._parent.execute(command, params)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     androidx.test.uiautomator.StaleObjectException; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
    E   Stacktrace:
    E   io.appium.uiautomator2.common.exceptions.StaleElementReferenceException: androidx.test.uiautomator.StaleObjectException
    E   	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:63)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)
    E   	at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    E   	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    E   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    E   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    E   	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    E   	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    E   	at java.lang.Thread.run(Thread.java:919)
    E   Caused by: androidx.test.uiautomator.StaleObjectException
    E   	at androidx.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java:647)
    E   	at androidx.test.uiautomator.UiObject2.hashCode(UiObject2.java:105)
    E   	at java.lang.Object.toString(Object.java:291)
    E   	at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2978)
    E   	at java.util.Formatter$FormatSpecifier.print(Formatter.java:2855)
    E   	at java.util.Formatter.format(Formatter.java:2524)
    E   	at java.util.Formatter.format(Formatter.java:2459)
    E   	at java.lang.String.format(String.java:2870)
    E   	at io.appium.uiautomator2.utils.ReflectionUtils.invoke(ReflectionUtils.java:85)
    E   	at io.appium.uiautomator2.core.AxNodeInfoExtractor.extractAxNodeInfo(AxNodeInfoExtractor.java:58)
    E   	at io.appium.uiautomator2.core.AxNodeInfoExtractor.toAxNodeInfo(AxNodeInfoExtractor.java:48)
    E   	at io.appium.uiautomator2.utils.ElementHelpers.getText(ElementHelpers.java:153)
    E   	at io.appium.uiautomator2.utils.ElementHelpers.getText(ElementHelpers.java:135)
    E   	at io.appium.uiautomator2.model.BaseElement.getText(BaseElement.java:151)
    E   	at io.appium.uiautomator2.handler.GetText.safeHandle(GetText.java:21)
    E   	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)
    E   	... 33 more
    



    Device sessions

    5. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    Device 2: Find Text by xpath: //*[starts-with(@text,'test message')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_1_1_public_chats.py:1417: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message was not delivered after resending from offline
    E    Message status was not changed to Delivered, it's Sent after back up online! 
    

    [[Data delivery issue]]

    Device sessions

    Passed tests (21)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    4. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_leave, id: 702845
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_undo_delete_message, id: 702869
    Device sessions

    3. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    4. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    2. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    3. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    @J-Son89 e2e fails are not PR related. Ready for merge.

    @J-Son89 J-Son89 merged commit 0522120 into develop Sep 28, 2023
    6 checks passed
    @J-Son89 J-Son89 deleted the standard-auth-process branch September 28, 2023 11:23
    ibrkhalil pushed a commit that referenced this pull request Oct 1, 2023
    * chore: move password input to connected component
    ---------
    
    Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com>
    Co-authored-by: frank <lovefree103@gmail.com>
    clauxx pushed a commit that referenced this pull request Oct 3, 2023
    * chore: move password input to connected component
    ---------
    
    Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com>
    Co-authored-by: frank <lovefree103@gmail.com>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Implement standardized in app authentication process