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

🎄 🧹 New Year cleanup #21868

Merged
merged 8 commits into from
Jan 6, 2025
Merged

🎄 🧹 New Year cleanup #21868

merged 8 commits into from
Jan 6, 2025

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Dec 25, 2024

Summary

We had 1000 warnings reported by clj-kondo.
Problem with having tons of warnings is that we are missing all the helpful tips, we just cant see them.

So what was done to deal with warnings:

  1. All unused code removed ruthlessly - 63 files deleted entirely. If we will need something again we can always find it in git. One piece of unused code had a comment like "do not delete, I will reuse it soon"... that comment was 2 years old :)
    Though few exceptions made, you can find them in .clj-kondo/config.edn in {:linters {:clojure-lsp/unused-public-var {:exclude ..}} section.
  2. re-frame/defn doesn't throw unused public var warning anymore, that was fixed in .clj-kondo/config.edn
  3. "deprecated" flag removed from re-frame/defn declaration. Because there are around 500 usages of it and this warning occupies all the log.
  4. react-native.core/use-effect was removed from deprecateds. Its usage generates a lot of warnings, but explanation why it shouldn't be used in guidelines is not quite clear. So if we really want to get rid of use-effect, lets make it a separate tech debt issue and discuss how it should be done.
  5. all other deprecated functions are still deprecated but I suppressed all the warnings with local comments. So if you see such comment - you can fix it ;)

Errors and warnings In develop:

Screenshot 2024-12-25 at 19 03 35

Screenshot 2024-12-25 at 19 04 02

Errors and warnings in this branch:

Review notes

Testing notes

Platforms

  • Android
  • iOS

Areas that maybe impacted

Potentially everything

Functional
  • 1-1 chats
  • public chats
  • group chats
  • wallet / transactions
  • dapps / app browsing
  • account recovery
  • new account
  • user profile updates
  • networks
  • mailservers
  • fleet
  • bootnodes

status: ready

@vkjr vkjr self-assigned this Dec 25, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Dec 25, 2024

Jenkins Builds

Click to see older builds (28)
Commit #️⃣ Finished (UTC) Duration Platform Result
78645ce #1 2024-12-25 13:04:37 ~3 min tests 📄log
✔️ 78645ce #1 2024-12-25 13:08:13 ~6 min ios 📱ipa 📲
✔️ 78645ce #1 2024-12-25 13:09:17 ~7 min android-e2e 🤖apk 📲
✔️ 78645ce #1 2024-12-25 13:09:18 ~7 min android 🤖apk 📲
cc89286 #2 2024-12-25 14:39:06 ~3 min tests 📄log
✔️ cc89286 #2 2024-12-25 14:42:25 ~6 min android-e2e 🤖apk 📲
✔️ cc89286 #2 2024-12-25 14:42:33 ~6 min ios 📱ipa 📲
✔️ cc89286 #2 2024-12-25 14:43:58 ~8 min android 🤖apk 📲
✔️ 886ed91 #3 2024-12-25 14:51:30 ~3 min tests 📄log
✔️ 886ed91 #3 2024-12-25 14:54:06 ~6 min ios 📱ipa 📲
✔️ 886ed91 #3 2024-12-25 14:54:08 ~6 min android-e2e 🤖apk 📲
✔️ 886ed91 #3 2024-12-25 14:54:44 ~7 min android 🤖apk 📲
✔️ 6cececa #4 2024-12-25 18:50:35 ~4 min tests 📄log
✔️ 6cececa #4 2024-12-25 18:52:48 ~6 min ios 📱ipa 📲
✔️ 6cececa #4 2024-12-25 18:53:57 ~7 min android-e2e 🤖apk 📲
✔️ 6cececa #4 2024-12-25 18:54:42 ~8 min android 🤖apk 📲
✔️ 6fb852b #5 2024-12-25 19:04:40 ~4 min tests 📄log
✔️ 6fb852b #5 2024-12-25 19:06:39 ~6 min android-e2e 🤖apk 📲
✔️ 6fb852b #5 2024-12-25 19:06:43 ~6 min ios 📱ipa 📲
✔️ 6fb852b #5 2024-12-25 19:08:18 ~8 min android 🤖apk 📲
✔️ 82df7f7 #6 2024-12-25 19:34:56 ~4 min tests 📄log
✔️ 82df7f7 #6 2024-12-25 19:36:58 ~6 min ios 📱ipa 📲
✔️ 82df7f7 #6 2024-12-25 19:37:14 ~6 min android 🤖apk 📲
✔️ 82df7f7 #6 2024-12-25 19:38:08 ~7 min android-e2e 🤖apk 📲
✔️ b2946d0 #7 2024-12-30 15:14:45 ~3 min tests 📄log
✔️ b2946d0 #7 2024-12-30 15:17:29 ~6 min ios 📱ipa 📲
✔️ b2946d0 #7 2024-12-30 15:18:51 ~8 min android-e2e 🤖apk 📲
✔️ b2946d0 #7 2024-12-30 15:19:10 ~8 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f0cb6ce #9 2025-01-02 14:07:44 ~4 min tests 📄log
✔️ f0cb6ce #9 2025-01-02 14:09:42 ~6 min android 🤖apk 📲
✔️ f0cb6ce #9 2025-01-02 14:09:59 ~7 min android-e2e 🤖apk 📲
✔️ f0cb6ce #9 2025-01-02 14:12:51 ~10 min ios 📱ipa 📲
✔️ d8df128 #10 2025-01-06 11:53:22 ~4 min tests 📄log
✔️ d8df128 #10 2025-01-06 11:55:44 ~6 min android-e2e 🤖apk 📲
✔️ d8df128 #10 2025-01-06 11:56:10 ~6 min ios 📱ipa 📲
✔️ d8df128 #10 2025-01-06 11:56:31 ~7 min android 🤖apk 📲

@vkjr vkjr changed the title [WIP] 🎄 🧹 New Year cleanup 🎄 🧹 New Year cleanup Dec 25, 2024
@briansztamfater
Copy link
Member

Thanks @vkjr for addressing this cleanup!

  1. All unused code removed ruthlessly - 63 files deleted entirely. If we will need something again we can always find it in git. One piece of unused code had a comment like "do not delete, I will reuse it soon"... that comment was 2 years old :)
    Though few exceptions made, you can find them in .clj-kondo/config.edn in {:linters {:clojure-lsp/unused-public-var {:exclude ..}} section.

@status-im/mobile, is there any reason to keep the legacy.status-im. namespaces? I feel they add little value now, and if any of that code is still needed in production, it might make more sense to move it into a status-im. namespace instead of keeping it marked as legacy. We would still have the Git history in case we need to bring back an old feature or check an old implementation.

Most of the legacy code is only used or referenced in legacy namespaces, so I feel the cleanup could be more extensive this way.

If this change is too broad for this PR, we could address it in a separate one. What do you think?

  1. react-native.core/use-effect was removed from deprecateds. Its usage generates a lot of warnings, but explanation why it shouldn't be used in guidelines is not quite clear. So if we really want to get rid of use-effect, lets make it a separate tech debt issue and discuss how it should be done.

If I remember correctly, we already discussed this during the last offsite and agreed to remove the deprecation. Therefore, removing the deprecation is the right approach, but the guidelines should also be updated accordingly. I'll tag @ilmotta here so we can confirm the outcome of that discussion in Montenegro.

@vkjr
Copy link
Contributor Author

vkjr commented Dec 26, 2024

@briansztamfater, I also think that 'legacy' folder should be cleaned more or removed altogether but that would take slightly different approach. Code should be moved around.
In this PR I concentrated only on warnings and deletions of obviously unused.
So yeah, lets do this separately :)

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.

This is an epic cleanup, well done 🙌

I left some small comments, apologies for any duplicates, it was easier to copy-and-paste some comments about naming.

Overall, I think things look good, though I wonder whether we should avoid suppressing warnings if we plan to do more PRs for resolving the warnings. For example, maybe we want to use the warnings for helping us find which code we want to revise next (?). Let me know your thoughts when you have a chance please 🙏

Comment on lines 235 to 242
st (state custom-domain? username usernames)]
(reset! resolve-last-id (random/id))
(merge
{:db (update db
:ens/registration assoc
:username username
:state state)}
(when (= state :searching)
:state st)}
(when (= st :searching)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe st could be named next-state?

Comment on lines 96 to 105
[{:keys [db] :as cofx} {h :hash :as transaction}]
(when-let [watch-params
(get-in db [:ethereum/watched-transactions hash])]
(get-in db [:ethereum/watched-transactions h])]
(let [{:keys [trigger-fn on-trigger]} watch-params]
(when (trigger-fn db transaction)
(rf/merge cofx
{:db (update db
:ethereum/watched-transactions
dissoc
hash)}
h)}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe h could be named transaction-hash or tx-hash?

Comment on lines 127 to 134
[{:keys [db] :as cofx} {h :hash :keys [id address] :as transfer}]
(let [transfer-by-hash (get-in db [:wallet-legacy :accounts address :transactions h])]
(when-let [unique-id (when-not (= transfer transfer-by-hash)
(if (and transfer-by-hash
(not (= :pending
(:type transfer-by-hash))))
id
hash))]
h))]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe h could be named transaction-hash or tx-hash?

Comment on lines 158 to 166
{h :hash block :block}]
(cond
(or (nil? min-block) (> min-block (js/parseInt block)))
{:min-block (js/parseInt block)
:min-block-transfers-count 1}

(and (= min-block block)
(nil? (get-in db [:wallet-legacy :accounts checksum :transactions hash])))
(nil? (get-in db [:wallet-legacy :accounts checksum :transactions h])))
(update acc :min-block-transfers-count inc)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe h could be named transaction-hash or tx-hash?

(get-in db [:wallet-legacy :accounts (eip55/address->checksum address) :max-block]))

(defn min-block-transfers-count
(defn min-block-transfers-count-fn
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this could be named count-min-block-transfers ?

Comment on lines 207 to 208
[{:keys [db]} k value]
{:db (-> db
(assoc-in [:bug-report/details key] value)
(assoc-in [:bug-report/details k] value)
(dissoc :bug-report/description-error))})
Copy link
Member

Choose a reason for hiding this comment

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

Maybe k could be named log-key?

Comment on lines 193 to 204
(defn hash-transaction
"used for keycard"
[rpcParams callback]
(log/debug "[native-module] hash-transaction")
(.hashTransaction ^js (encryption) rpcParams callback))

(defn hash-message
"used for keycard"
[message callback]
(log/debug "[native-module] hash-message")
(.hashMessage ^js (encryption) message callback))

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if these native bindings should get some extra review since they could still be valuable references to old/upcoming features. Some of these seem they might be related to some upcoming keycard features for signing transactions and etc, but I'm not sure.

cc @flexsurfer @ilmotta

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point @seanstrom This namespace I'd consider leaving untouched with unused public vars so that it serves as a reference API. Also, if we remove from the Clojure layer, we should remove from the native layer as well in the repo. Maybe some of these functions are not even used by the desktop client, in which case we can also remove from status-go.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, we should leave it as is, since some of these (hash-typed-data/hash-typed-data-v4) are being used in a WIP keycard branch

Comment on lines 113 to 114
;; deprecated warning suppressed but please rewrite if you have time
#_{:clj-kondo/ignore [:deprecated-var]}
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should try formatting these comments with a prefix like: TODO: deprecated ..., so that they're easier to search for throughout the code. thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have 86 TODOs in the code already) I don't think increasing this value by 100 with those deprecated suppression would make any change. Plus, we aren't really need rewriting what is deprecated. It would be nice, it would be better but it is not really a TODO.

Overall, I think things look good, though I wonder whether we should avoid suppressing warnings if we plan to do more PRs for resolving the warnings.

Overall I'd prefer maintaining a zero-warnings policy (and ensuring it with the automatic PR check). To be sure that if anything triggered a warning in the future - that was seen and fixed. And warnings that we already have... well it is possible that we will fix them but it is also possible that not. In any case old warnings shouldn't stay in our way of preventing new ones. wdyt?

@vkjr
Copy link
Contributor Author

vkjr commented Dec 27, 2024

@seanstrom, thanks for all the comments, agree with the renamings!

Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

Such a nice gift for Christmas @vkjr! Thank you!

react-native.core/use-effect was removed from deprecateds.

We had an agreement between us that use-effect shouldn't be considered deprecated, so I think this is fine.

"deprecated" flag removed from re-frame/defn declaration.

Makes sense to me. We all know this is super deprecated and every now and then people rewrite usages of this macro.


The sticky point for me is that I don't currently agree with the addition of so many warning suppression comments.

When we run make lint we ignore all clj-kondo warnings via grep, thus why do we want to suppress warnings twice (code & make target)? When the dev wants to see the full list of warnings, they can run make lint CLJ_LINTER_PRINT_WARNINGS=true. The dev can also easily pipe a grep to filter/focus on certain warnings.

This is a flexible approach that doesn't require adding suppression comments.

When we add suppression comments, we are removing a nice hint in text editors for the developer to see the warning and we are also making the code noisy because the code #_{:clj-kondo/ignore [:deprecated-namespace]} is noisier than a squiggle line or hint (depending on the text editor). The suppression comment is also tied to the code structure and must be moved around correctly.

When I work with warnings, I don't care about the whole list of warnings because I want to fix one type of warning at a time, and for that reason I grep only specific warnings.

The correct IMO is to resolve warnings in bite-size PRs, not suppress them (unless it's really an exception).

@@ -548,8 +502,8 @@

(rf/defn lock-pressed
{:events [:browser.ui/lock-pressed]}
[cofx secure?]
(update-browser-option cofx :show-tooltip (if secure? :secure :not-secure)))
[cofx is-secure?]
Copy link
Contributor

@ilmotta ilmotta Dec 27, 2024

Choose a reason for hiding this comment

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

Why this change from secure? to is-secure? ? secure? follows the Clojure style guide our style guide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably was shadowing something, will check!

@@ -1,8 +1,7 @@
(ns legacy.status-im.utils.utils-test
(:require
[cljs.test :refer-macros [deftest is]]
[legacy.status-im.utils.core :as u]
[legacy.status-im.utils.utils :as uu]))
[legacy.status-im.utils.core :as u]))
Copy link
Contributor

Choose a reason for hiding this comment

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

We sort of have a convention to use sut as the alias for the namespace under test. Could you alias to sut instead of u?

Comment on lines 193 to 204
(defn hash-transaction
"used for keycard"
[rpcParams callback]
(log/debug "[native-module] hash-transaction")
(.hashTransaction ^js (encryption) rpcParams callback))

(defn hash-message
"used for keycard"
[message callback]
(log/debug "[native-module] hash-message")
(.hashMessage ^js (encryption) message callback))

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point @seanstrom This namespace I'd consider leaving untouched with unused public vars so that it serves as a reference API. Also, if we remove from the Clojure layer, we should remove from the native layer as well in the repo. Maybe some of these functions are not even used by the desktop client, in which case we can also remove from status-go.

:test/assoc-in
(fn [app-db [_ path value]]
(assoc-in app-db path value))))

(defn spy-event-fx
Copy link
Contributor

Choose a reason for hiding this comment

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

When I wrote abstractions like spy-event-fx I was trying to come up with an intermediary solution between our current integration tests and unit testing event handlers like we do now. I didn't like the experience and the brittleness of this spying/stubbing solution for events, so I stopped using this.

If you can remove in this PR, please remove spy-event-fx, spy-fx, stub-fx-with-callbacks. I think db function can also be removed if there are no usages.

@@ -39,15 +39,23 @@
(defn percentage-change
[customization-color theme]
{:color (colors/theme-colors
;; deprecated warning suppressed but please rewrite if you have time
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels excessive to have two comments the same thing. The clj-kondo clearly means it's suppressing a warning. If you agree, could you remove all such ;; deprecated warning ... comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I won't insist too much on having also textual comment but think that it makes better call to action in comparison to just having a suppressed warning. So better chance to have warnings fixed :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@vkjr I think we just need to prioritize some tech debt work every now and then since it's not happening organically. In particular, warning removal tends to go low in most devs' priorities, so it's natural that they accumulate over time. This happened in all projects I worked in. Adding more comments to increase noise may work, but I don't hold my hopes high.

;; be removed:
keycard.keycard
test-helpers.unit
test-helpers.component
Copy link
Contributor

Choose a reason for hiding this comment

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

The unused vars in test-helpers.component: after-each, test-only, describe-only, and describe-skip can also be used only temporarily during development, thus not necessarily to commit. For this namespace in particular I think we can just ignore the unused public vars, but shouldn't consider deleting.

@vkjr
Copy link
Contributor Author

vkjr commented Dec 28, 2024

@ilmotta

When we run make lint we ignore all clj-kondo warnings via grep, thus why do we want to suppress warnings twice (code & make target)?

Yes, currently we ignore warnings in linting. And we allow the new code to be committed with warnings. But I suggest to only commit code without warnings :)

To start forcing "no-warnings" policy we need to get rid of ALL existing warnings. Lets be honest, we won't make anytime soon an effort to really remove them. But that shouldn't stop us from implementing no-warnings policy. We can suppress an existing ones and never add new. And slowly fix already existing but suppressed.

When we add suppression comments, we are removing a nice hint in text editors for the developer to see the warning and we are also making the code noisy

Yes, editor hint is nice, but as we can see from the experience, having a thousand hints in editor just makes us blind to the warnings :) On the other side when there were no warnings in develop and now there are one or two in your local branch, you know that you are responsible and need to fix them.

And I don't really think that ugliness of suppression comment is a bad thing. Maybe it is something that would push us to fix those parts instead of ignoring them.

So in the end of the day my suggestion is to have all existing warnings suppressed and start having no-warnings policy. What do you think?

I'd be happy to hear more opinions on this point from the team.
cc @flexsurfer, @ulisesmac, @briansztamfater, @clauxx, @shivekkhurana, @seanstrom

@vkjr
Copy link
Contributor Author

vkjr commented Dec 28, 2024

@ilmotta, thanks for checking the pr! 🙏

@seanstrom
Copy link
Member

seanstrom commented Dec 29, 2024

@vkjr I like the idea of avoiding deprecation warnings and limiting what kind of code we check-in to the codebase 👍

Though I think we should try to resolve the current warnings as soon as possible to get the best benefits. So with that in mind I've tried to help with cleaning up some of the new deprecation warning suppressions (the one's introduced in this PR) by creating another PR based on these changes that try to resolve a good chunk of the warnings there: #21874

Hopefully this will help with merging this PR and enabling the zero-warnings policy 🙌

Lmk your thoughts when you have a chance 🙏

@vkjr
Copy link
Contributor Author

vkjr commented Dec 30, 2024

@seanstrom, wow, thanks a lot!

Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

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

😮 Thanks a lot @vkjr!!

IMO it would make sense to start with a zero-warnings policy only after we actually solve all the warnings (like you and @seanstrom did), instead of leaving some suppressed. Otherwise suppressing warnings might become a path of least resistance for CCs if we have examples of that in the codebase.

.clj-kondo/config.edn Show resolved Hide resolved
@vkjr
Copy link
Contributor Author

vkjr commented Jan 2, 2025

@ilmotta, @clauxx, @seanstrom, @briansztamfater
I've fixed the review notes, reverted src.native-module.core and removed all the warnings suppression. Please, take a look.

Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks @vkjr 🎆

@ilmotta
Copy link
Contributor

ilmotta commented Jan 3, 2025

But I suggest to only commit code without warnings :)

@vkjr, what you are suggesting is exactly how clj-kondo was configured in the past. Warnings were considered errors and make lint would return non-zero status on any warning.

We changed this configuration because we wanted to leverage the :deprecated metadata as described in the Clojure style guide since we try to follow it and to give ourselves a way to progressively evolve the code.

@seanstrom @clauxx @vkjr Going back to a zero-warning policy also means going back to where we were before, where we sometimes wouldn't make the first move because it would be too expensive for any single developer to attack the problem. I remember when we started to allow cheap deprecation via metadata (not renaming vars which is a world of pain) we started to effectively deprecate code and gradually evolve instead of being stuck. There are also some linters which can generate false positive and these can be useful too (like our translation linter).

I can live with either approach guys, but prefer the flexibility of allowing warnings. If the majority prefers, the best to reinforce the policy is to change clj-kondo --fail-level option to warning or just delete this flag because it's the default clj-kondo behavior.

I'll try to fix some of the warnings to help. I see @seanstrom already fixed some in another PR.

Yes, editor hint is nice, but as we can see from the experience, having a thousand hints in editor just makes us blind to the warnings :)

Maybe it's just me, but I 95% of the time care about the warnings in the files I'm working on. I don't fully understand why checking all the possible warnings in the entire project is useful during development. My Emacs only reports warnings for the buffers I'm in and usually there are very few (if any) warnings per buffer. In which way does your Emacs throw thousands of warnings to you? Could you detail a little bit how the warnings are affecting your workflow?

And I don't really think that ugliness of suppression comment is a bad thing. Maybe it is something that would push us to fix those parts instead of ignoring them.

Suppression comments are okay if there aren't too many, otherwise I think it's better for the teams to prioritize some work to attack the tech debt instead of indirectly using comments. It's similar to TODO comments, they basically don't work unless there are very few and that's why we added to the guidelines to not use them. It's like the broken windows theory, if we have too many suppression comments/TODO comments nobody will care. But hey, this PR is bringing the problem back to the spotlight, which is a great move!

Probably a better solution to generate noise about warnings is to make them visible during continuous integration, similar to how status-go reports test coverage in PRs. This way PR author and reviewers would easily spot when PRs are making things worse or when the number of warnings exceeded a certain threshold.

Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri left a comment

Choose a reason for hiding this comment

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

Impressive work! I’m a big fan of less code with the same great functionality 🔥

@mariia-skrypnyk mariia-skrypnyk self-assigned this Jan 3, 2025
@status-im-auto
Copy link
Member

84% of end-end tests have passed

Total executed tests: 56
Failed tests: 6
Expected to fail tests: 3
Passed tests: 47
IDs of failed tests: 702844,704613,703496,702783,702782,702784 
IDs of expected to fail tests: 727230,741054,727229 

Failed tests (6)

Click to expand
  • Rerun failed tests

  • 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:177: in test_1_1_chat_emoji_send_reply_and_open_link
        self.errors.verify_no_errors()
    base_test_case.py:209: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     URL was not opened from 1-1 chat
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844

    Device 2: Find ChatMessageInput by accessibility id: chat-message-input
    Device 2: Type https://youtu.be/Je7yErjEVt4 to ChatMessageInput

    critical/chats/test_public_chat_browsing.py:612: in test_community_links_with_previews_github_youtube_twitter_gif_send_enable
        self.channel_2.url_preview_composer.wait_for_element(20)
    ../views/base_element.py:129: in wait_for_element
        raise TimeoutException(
     Device `2`: `Button` by` accessibility id`: `url-preview` is not found on the screen after wait_for_element
    



    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613

    Device 1: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/u/CweACg0KC1Rlc3RVc2VyRTJFAw==#zQ3shcFXYnGXxJZnsMThziUNMwyA5uGLp58bLGmfb3qaWD1F6')]

    critical/test_deep_and_universal_links.py:41: in test_links_open_universal_links_from_chat
        self.channel.chat_element_by_text(url).click_on_link_inside_message_body()
    ../views/chat_view.py:142: in click_on_link_inside_message_body
        self.message_body.click_inside_element_by_coordinate(rel_x=0.1, rel_y=0.9)
    ../views/base_element.py:365: in click_inside_element_by_coordinate
        location, size = self.get_element_coordinates()
    ../views/base_element.py:289: in get_element_coordinates
        location = element.location
    ../../../../status-app-prs-rerun@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:286: in location
        old_loc = self._execute(Command.GET_ELEMENT_RECT)["value"]
    ../../../../status-app-prs-rerun@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:395: in _execute
        return self._parent.execute(command, params)
    ../../../../status-app-prs-rerun@2@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs-rerun@2@tmp/venv/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     The element 'By.xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/u/CweACg0KC1Rlc3RVc2VyRTJFAw==#zQ3shcFXYnGXxJZnsMThziUNMwyA5uGLp58bLGmfb3qaWD1F6')]' is not linked to the same object in DOM anymore; 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: The element 'By.xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/u/CweACg0KC1Rlc3RVc2VyRTJFAw==#zQ3shcFXYnGXxJZnsMThziUNMwyA5uGLp58bLGmfb3qaWD1F6')]' is not linked to the same object in DOM anymore
    E   	at io.appium.uiautomator2.model.ElementsCache.restore(ElementsCache.java:122)
    E   	at io.appium.uiautomator2.model.ElementsCache.get(ElementsCache.java:153)
    E   	at io.appium.uiautomator2.handler.GetRect.safeHandle(GetRect.java:40)
    E   	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:259)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:253)
    E   	at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:77)
    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:1012)
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_mute_chat, id: 703496

    Test setup failed: critical/chats/test_1_1_public_chats.py:557: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:398: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:168: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:165: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:163: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by xpath:`//*[contains(@text, 'shvvZHGapRYFQ8JRjSw2')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` is not found on the screen after wait_for_visibility_of_element
    



    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    Device 2: Tap on found: Button
    Device 2: Attempt 0 is successful clicking close-activity-center

    Test setup failed: critical/chats/test_1_1_public_chats.py:557: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:398: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:168: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:165: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:163: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by xpath:`//*[contains(@text, 'shvvZHGapRYFQ8JRjSw2')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    3. test_1_1_chat_delete_via_long_press_relogin, id: 702784

    Test setup failed: critical/chats/test_1_1_public_chats.py:557: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:398: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:168: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:165: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:163: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by xpath:`//*[contains(@text, 'shvvZHGapRYFQ8JRjSw2')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` is not found on the screen after wait_for_visibility_of_element
    



    Expected to fail tests (3)

    Click to expand

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 1: Could not reach Button by pressing system back button
    Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

    critical/test_wallet.py:165: in test_wallet_send_asset_from_drawer
        sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
    critical/test_wallet.py:38: in _get_balances_before_tx
        sender_balance = self.network_api.get_balance(self.sender['wallet_address'])
    ../support/api/network_api.py:55: in get_balance
        return int(balance) / 1000000000000000000
     invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 
    

    [[Arbiscan API is down, looking for analogue]]

    2. test_wallet_send_eth, id: 727229

    Device 2: Tap on found: Button
    Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

    critical/test_wallet.py:130: in test_wallet_send_eth
        sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
    critical/test_wallet.py:38: in _get_balances_before_tx
        sender_balance = self.network_api.get_balance(self.sender['wallet_address'])
    ../support/api/network_api.py:55: in get_balance
        return int(balance) / 1000000000000000000
     invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 
    

    [[Arbiscan API is down, looking for analogue]]

    Class TestFallbackMultipleDevice:

    1. test_fallback_add_key_pair, id: 741054

    Device 2: Tap on found: Button
    Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

    critical/test_fallback.py:232: in test_fallback_add_key_pair
        expected_balance = self.network_api.get_balance(key_pair_account_address)
    ../support/api/network_api.py:55: in get_balance
        return int(balance) / 1000000000000000000
     invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 
    

    [[Arbiscan API is down, looking for analogue]]

    Passed tests (47)

    Click to expand

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_leave, id: 702845
    Device sessions

    2. test_community_mentions_push_notification, id: 702786
    Device sessions

    3. test_community_markdown_support, id: 702809
    Device sessions

    4. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    5. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_unread_messages_badge, id: 702841
    Device sessions

    5. test_community_message_delete, id: 702839
    Device sessions

    6. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    7. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    8. test_community_one_image_send_reply, id: 702859
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_several_images_send_reply, id: 703194
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    3. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    4. test_community_undo_delete_message, id: 702869
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    6. test_community_discovery, id: 703503
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestFallbackMultipleDevice:

    1. test_fallback_sync_with_error, id: 740220
    2. test_fallback_with_correct_seed_phrase, id: 740221
    3. test_fallback_validate_seed_phrase, id: 740222

    Class TestDeepLinksOneDevice:

    1. test_links_deep_links_profile, id: 702775
    Device sessions

    2. test_deep_links_communities, id: 739307
    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

    3. test_add_contact_field_validation, id: 702777
    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_offline_pn, id: 702808
    Device sessions

    4. test_group_chat_pin_messages, id: 702732
    Device sessions

    5. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    6. test_group_chat_mute_chat, id: 703495
    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_pin_messages, id: 702731
    Device sessions

    5. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    6. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    7. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    @mariia-skrypnyk
    Copy link

    mariia-skrypnyk commented Jan 3, 2025

    Hi @vkjr !

    Thanks for your cleanup!
    Looks great!
    I've did full e2e run and it looks good, fails seems not to be related.
    Also manually did smoke for main parts of app.

    PR can be merged.

    @vkjr
    Copy link
    Contributor Author

    vkjr commented Jan 5, 2025

    @mariia-skrypnyk, thank you!

    @vkjr vkjr merged commit 28a81f2 into develop Jan 6, 2025
    5 checks passed
    @vkjr vkjr deleted the unused-cleanup branch January 6, 2025 12:03
    @ulisesmac
    Copy link
    Contributor

    @vkjr a bit late, but thanks for this PR! :) 💯

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

    Successfully merging this pull request may close these issues.

    9 participants