Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some of the freezes experienced by the admins when the community updates #16384

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

jrainville
Copy link
Member

What does the PR do

Iterates #16043

When the community gets updated by any means, we reconstruct the section item, which is already bad, but we also re-fetch all tokens and all shared addresses, which in turn re-updates models for no reason.

Instead, I make sure to only fetch those on first section build, then, I get the new shared addresses when members join using the request to join response that comes from status-go

Status-go PR to fix the correct return of the shared addresses: status-im/status-go#5867

A further improvement IMO would be to stop redoing the section when the community updates, but we'll need to be careful, because it might break a lot of places that would normally update automatically.

Also includes a commit that makes the input focus and fixes the order of members in the airdrop popups.

Affected areas

  • Members' shared addresses (for airdropping for example)
  • List of tokens
  • Airdrop popup (order and focus on input)

Architecture compliance

  • I am familiar with the application architecture and agreed good practices.
    My PR is consistent with this document: Architecture guidelines

Impact on end user

The general responsiveness of the app when the community updates for admins should be better (no or less freezes)

How to test

Update the community, make people join, check that you have their airdrop address in the airdrop popup.

Risk

Tick one:

  • Low risk: 2 devs MUST perform testing as specified above and attach their results as comments to this PR before merging.
  • High risk: QA team MUST perform additional testing in the specified affected areas before merging.

Worst case is that some properties don't get updated until a restart (for example the airdrop addresses of members)

@jrainville jrainville requested review from a team, iurimatias, glitchminer, igor-sirotin and caybro and removed request for a team September 23, 2024 20:18
@status-im-auto
Copy link
Member

status-im-auto commented Sep 23, 2024

Jenkins Builds

Click to see older builds (77)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f8e458b #1 2024-09-23 20:26:10 ~6 min tests/nim 📄log
✔️ f8e458b #1 2024-09-23 20:26:27 ~7 min macos/aarch64 🍎dmg
✔️ f8e458b #1 2024-09-23 20:29:21 ~10 min macos/x86_64 🍎dmg
f8e458b #1 2024-09-23 20:32:20 ~13 min tests/ui 📄log
✔️ f8e458b #1 2024-09-23 20:36:19 ~17 min linux-nix/x86_64 📦tgz
✔️ f8e458b #1 2024-09-23 20:36:40 ~17 min linux/x86_64 📦tgz
✔️ f8e458b #1 2024-09-23 20:42:15 ~23 min windows/x86_64 💿exe
✔️ e389f38 #2 2024-09-24 18:48:23 ~6 min tests/nim 📄log
✔️ e389f38 #2 2024-09-24 18:49:42 ~8 min macos/aarch64 🍎dmg
✔️ e389f38 #2 2024-09-24 18:50:05 ~8 min macos/x86_64 🍎dmg
e389f38 #2 2024-09-24 18:52:59 ~11 min tests/ui 📄log
✔️ e389f38 #2 2024-09-24 18:55:56 ~14 min linux-nix/x86_64 📦tgz
✔️ e389f38 #2 2024-09-24 18:58:23 ~16 min linux/x86_64 📦tgz
✔️ e389f38 #2 2024-09-24 19:02:04 ~20 min windows/x86_64 💿exe
✔️ caf63e6 #3 2024-09-24 19:26:40 ~6 min macos/aarch64 🍎dmg
✔️ caf63e6 #3 2024-09-24 19:27:05 ~6 min tests/nim 📄log
✔️ caf63e6 #3 2024-09-24 19:28:17 ~7 min macos/x86_64 🍎dmg
caf63e6 #3 2024-09-24 19:32:52 ~12 min tests/ui 📄log
✔️ caf63e6 #3 2024-09-24 19:33:32 ~13 min linux-nix/x86_64 📦tgz
✔️ caf63e6 #3 2024-09-24 19:34:33 ~14 min linux/x86_64 📦tgz
✔️ caf63e6 #3 2024-09-24 19:38:54 ~18 min windows/x86_64 💿exe
✔️ c8c7aef #4 2024-09-25 18:48:56 ~4 min macos/aarch64 🍎dmg
✔️ c8c7aef #4 2024-09-25 18:51:03 ~6 min tests/nim 📄log
✔️ c8c7aef #4 2024-09-25 18:52:13 ~7 min macos/x86_64 🍎dmg
✔️ c8c7aef #4 2024-09-25 18:56:05 ~11 min tests/ui 📄log
✔️ c8c7aef #4 2024-09-25 18:58:37 ~14 min linux-nix/x86_64 📦tgz
✔️ c8c7aef #4 2024-09-25 19:00:33 ~16 min linux/x86_64 📦tgz
✔️ c8c7aef #4 2024-09-25 19:04:37 ~20 min windows/x86_64 💿exe
✔️ af6bf72 #5 2024-09-25 19:37:09 ~6 min macos/aarch64 🍎dmg
✔️ af6bf72 #5 2024-09-25 19:37:50 ~6 min tests/nim 📄log
✔️ af6bf72 #5 2024-09-25 19:39:28 ~8 min macos/x86_64 🍎dmg
✔️ af6bf72 #5 2024-09-25 19:44:39 ~13 min tests/ui 📄log
✔️ af6bf72 #5 2024-09-25 19:45:32 ~14 min linux-nix/x86_64 📦tgz
✔️ af6bf72 #5 2024-09-25 19:46:34 ~15 min linux/x86_64 📦tgz
✔️ af6bf72 #5 2024-09-25 19:50:13 ~19 min windows/x86_64 💿exe
✔️ e3d922e #6 2024-09-27 15:33:49 ~4 min macos/aarch64 🍎dmg
✔️ e3d922e #6 2024-09-27 15:37:38 ~8 min macos/x86_64 🍎dmg
✔️ e3d922e #6 2024-09-27 15:40:32 ~11 min tests/nim 📄log
✔️ e3d922e #6 2024-09-27 15:46:02 ~16 min tests/ui 📄log
✔️ e3d922e #6 2024-09-27 15:47:55 ~18 min linux-nix/x86_64 📦tgz
✔️ e3d922e #6 2024-09-27 15:49:23 ~20 min windows/x86_64 💿exe
✔️ e3d922e #6 2024-09-27 15:50:10 ~20 min linux/x86_64 📦tgz
e3d922e #7 2024-09-27 17:32:19 ~3 min macos/x86_64 📄log
✔️ e3d922e #7 2024-09-27 17:35:07 ~6 min tests/nim 📄log
✔️ e3d922e #7 2024-09-27 17:35:19 ~6 min macos/aarch64 🍎dmg
e3d922e #7 2024-09-27 17:40:31 ~11 min tests/ui 📄log
✔️ e3d922e #7 2024-09-27 17:42:20 ~13 min linux-nix/x86_64 📦tgz
✔️ e3d922e #7 2024-09-27 17:44:42 ~15 min linux/x86_64 📦tgz
✔️ e3d922e #7 2024-09-27 17:46:40 ~17 min windows/x86_64 💿exe
✔️ 82cb9d8 #8 2024-09-27 18:01:20 ~5 min macos/aarch64 🍎dmg
✔️ 82cb9d8 #8 2024-09-27 18:02:20 ~6 min tests/nim 📄log
✔️ 82cb9d8 #8 2024-09-27 18:03:38 ~8 min macos/x86_64 🍎dmg
✔️ 82cb9d8 #8 2024-09-27 18:07:41 ~12 min tests/ui 📄log
✔️ 82cb9d8 #8 2024-09-27 18:08:52 ~13 min linux-nix/x86_64 📦tgz
✔️ 82cb9d8 #8 2024-09-27 18:11:18 ~15 min linux/x86_64 📦tgz
✔️ 82cb9d8 #8 2024-09-27 18:13:48 ~18 min windows/x86_64 💿exe
✔️ 377f364 #9 2024-10-01 14:43:39 ~6 min macos/aarch64 🍎dmg
✔️ 377f364 #9 2024-10-01 14:44:06 ~6 min tests/nim 📄log
✔️ 377f364 #9 2024-10-01 14:45:37 ~8 min macos/x86_64 🍎dmg
✔️ 377f364 #9 2024-10-01 14:49:22 ~11 min tests/ui 📄log
✔️ 377f364 #9 2024-10-01 14:51:06 ~13 min linux-nix/x86_64 📦tgz
✔️ 377f364 #9 2024-10-01 14:53:21 ~15 min linux/x86_64 📦tgz
✔️ 377f364 #9 2024-10-01 14:56:41 ~19 min windows/x86_64 💿exe
✔️ dc533c9 #10 2024-10-01 18:44:14 ~6 min macos/aarch64 🍎dmg
✔️ dc533c9 #10 2024-10-01 18:44:26 ~6 min tests/nim 📄log
✔️ dc533c9 #10 2024-10-01 18:47:16 ~9 min macos/x86_64 🍎dmg
✔️ dc533c9 #10 2024-10-01 18:49:58 ~11 min tests/ui 📄log
✔️ dc533c9 #10 2024-10-01 18:50:59 ~12 min linux-nix/x86_64 📦tgz
✔️ dc533c9 #10 2024-10-01 18:53:54 ~15 min linux/x86_64 📦tgz
✔️ dc533c9 #10 2024-10-01 18:57:42 ~19 min windows/x86_64 💿exe
✔️ 1231e7a #11 2024-10-02 19:19:48 ~6 min macos/aarch64 🍎dmg
✔️ 1231e7a #11 2024-10-02 19:20:28 ~6 min tests/nim 📄log
✔️ 1231e7a #11 2024-10-02 19:21:54 ~8 min macos/x86_64 🍎dmg
✔️ 1231e7a #11 2024-10-02 19:25:14 ~11 min tests/ui 📄log
✔️ 1231e7a #11 2024-10-02 19:27:39 ~14 min linux-nix/x86_64 📦tgz
✔️ 1231e7a #11 2024-10-02 19:29:23 ~15 min linux/x86_64 📦tgz
✔️ 1231e7a #11 2024-10-02 19:32:59 ~19 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e32bf8d #12 2024-10-07 18:16:32 ~5 min macos/aarch64 🍎dmg
✔️ e32bf8d #12 2024-10-07 18:17:41 ~6 min tests/nim 📄log
✔️ e32bf8d #12 2024-10-07 18:19:33 ~8 min macos/x86_64 🍎dmg
e32bf8d #12 2024-10-07 18:22:49 ~11 min tests/ui 📄log
✔️ e32bf8d #12 2024-10-07 18:25:09 ~14 min linux-nix/x86_64 📦tgz
✔️ e32bf8d #12 2024-10-07 18:26:39 ~15 min linux/x86_64 📦tgz
✔️ e32bf8d #12 2024-10-07 18:30:50 ~19 min windows/x86_64 💿exe
e32bf8d #13 2024-10-07 19:01:33 ~11 min tests/ui 📄log
✔️ e32bf8d #14 2024-10-09 10:52:15 ~11 min tests/ui 📄log
✔️ e32bf8d #15 2024-10-09 14:17:42 ~11 min tests/ui 📄log
✔️ d89fc4e #13 2024-10-10 15:26:14 ~4 min macos/aarch64 🍎dmg
✔️ d89fc4e #13 2024-10-10 15:29:05 ~7 min tests/nim 📄log
d89fc4e #16 2024-10-10 15:33:05 ~11 min tests/ui 📄log
✔️ d89fc4e #13 2024-10-10 15:33:27 ~11 min macos/x86_64 🍎dmg
✔️ d89fc4e #13 2024-10-10 15:35:58 ~14 min linux-nix/x86_64 📦tgz
✔️ d89fc4e #13 2024-10-10 15:36:38 ~15 min linux/x86_64 📦tgz
✔️ d89fc4e #13 2024-10-10 15:43:39 ~22 min windows/x86_64 💿exe
d89fc4e #17 2024-10-10 15:49:26 ~12 min tests/ui 📄log
✔️ d89fc4e #18 2024-10-10 16:12:06 ~11 min tests/ui 📄log

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@micieslak micieslak left a comment

Choose a reason for hiding this comment

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

Looks ok in general. Some small suggestions only.

Comment on lines 527 to 529
function matchesAlias(name, filter) {
return name.split(" ").some(p => p.startsWith(filter))
}
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 why alias needs to be handled in a special way here. If it's not necessary we could optimize it in a similar way as described here: https://github.com/status-im/status-desktop/pull/16363/files#r1774985033

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried this and it ended up being way slower actually 🤔
Maybe it's because there are so many properties?

Copy link
Member

Choose a reason for hiding this comment

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

That's quite surprising 🤔 So let's leave it as it is :)

Bth, looking into code of SFPM I have a temptation to rewrite it from scratch 🤦

FastExpressionFilter {
expression: !!model.airdropAddress
expectedRoles: ["airdropAddress"]
}
Copy link
Member

Choose a reason for hiding this comment

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

If it's about check if airdropAddress is not empty string, ValueFilter could be used:

ValueFilter {
  roleName: "airdropAddress"
  value: ""
  inverted: true
}

@jrainville jrainville force-pushed the fix/slow-admin-tab branch 2 times, most recently from f3efcdb to fbd6c7c Compare September 26, 2024 19:19
@jrainville
Copy link
Member Author

@igor-sirotin reminder to review please

@jrainville
Copy link
Member Author

@glitchminer can you test when you have time.

No need for a full regression test. You can check the "what to test" section in the PR

Base automatically changed from fix/slow-admin-tab to master September 27, 2024 17:28
@jrainville jrainville force-pushed the fix/freeze-on-update branch 2 times, most recently from 82cb9d8 to 377f364 Compare October 1, 2024 14:37
@jrainville
Copy link
Member Author

status-go updated to point to develop.

@jrainville jrainville force-pushed the fix/freeze-on-update branch from dc533c9 to 1231e7a Compare October 2, 2024 19:13
@jrainville jrainville force-pushed the fix/freeze-on-update branch from 1231e7a to e32bf8d Compare October 7, 2024 18:10
@jrainville jrainville requested review from alexjba and a team as code owners October 7, 2024 18:10
@jrainville
Copy link
Member Author

Rebased. @caybro could you do the testing on this one please.

@caybro
Copy link
Member

caybro commented Oct 8, 2024

Rebased. @caybro could you do the testing on this one please.

Sure; any hints on how to trigger the behavior and how to test?

@jrainville
Copy link
Member Author

Rebased. @caybro could you do the testing on this one please.

Sure; any hints on how to trigger the behavior and how to test?

I don,t think you'll be able to replicate the freezes, because you're gonna need to be an admin in a community as big as the Status community, but just testing that everything in the Affected Areas listed above still works as expected would be good.

For example, making sure you get the airdrop address of new joiners without having to restart the app (check the member list in the airdrop admin panel)

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

Tested 👍 , found 2 minor unrelated issues (will turn those to standalone bugs):

  • missing "crown" in a token gated channel
  • the "lock" mini icon is only displayed in the channel list, but not in the channel header button up top

image

Iterates #16043

When the community gets updated by any means, we reconstruct the section item, which is already bad, but we also re-fetch all tokens and all shared addresses, which in turn re-updates models for no reason.

Instead, I make sure to only fetch those on first section build, then, I get the new shared addresses when members join using the request to join response that comes from status-go
@jrainville jrainville force-pushed the fix/freeze-on-update branch from e32bf8d to d89fc4e Compare October 10, 2024 15:21
@jrainville
Copy link
Member Author

Rebased. I'll merge once it's green

@jrainville
Copy link
Member Author

Force merging as the e2e fail is a test in the onboarding, which I didn't touch at all

@jrainville jrainville merged commit 0bb2bc0 into master Oct 10, 2024
8 of 9 checks passed
@jrainville jrainville deleted the fix/freeze-on-update branch October 10, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants