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_: mitigate permission stuck in pending state #5070

Merged

Conversation

kounkou
Copy link
Contributor

@kounkou kounkou commented Apr 18, 2024

Description

This PR mitigates permission stuck in pending state upon making device a control node. It fixes #14023 by applying events and publishing community events once the device is promoted to control node.

System Design

The main design decision for this issue is that promoteSelfToControlNode is inhibited when the community doesn't have a minted Owner token. From the UI perspective, the action is disabled similar to when the user is an admin user. And from the backend perspective, the action is also rejected with missing owner token code.

Screenshot from 2024-05-09 15-59-48

@status-im-auto
Copy link
Member

status-im-auto commented Apr 18, 2024

Jenkins Builds

Click to see older builds (83)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 44f4212 #1 2024-04-18 08:34:56 ~4 min linux 📦zip
✔️ 44f4212 #1 2024-04-18 08:36:06 ~5 min android 📦aar
✔️ 44f4212 #1 2024-04-18 08:36:13 ~5 min ios 📦zip
✔️ 44f4212 #1 2024-04-18 09:15:43 ~45 min tests 📄log
✔️ 67327a6 #2 2024-04-18 18:58:01 ~2 min linux 📦zip
✔️ 67327a6 #2 2024-04-18 18:58:48 ~3 min ios 📦zip
✔️ 67327a6 #2 2024-04-18 19:01:00 ~5 min android 📦aar
✔️ 67327a6 #2 2024-04-18 19:36:59 ~41 min tests 📄log
✔️ cd10710 #3 2024-04-19 08:01:20 ~1 min android 📦aar
✔️ cd10710 #3 2024-04-19 08:01:51 ~2 min linux 📦zip
✔️ cd10710 #3 2024-04-19 08:04:33 ~4 min ios 📦zip
✖️ cd10710 #3 2024-04-19 08:34:58 ~35 min tests 📄log
✖️ fab6ab3 #4 2024-04-24 12:44:57 ~1 min tests 📄log
✔️ fab6ab3 #4 2024-04-24 12:47:19 ~3 min linux 📦zip
✔️ fab6ab3 #4 2024-04-24 12:47:38 ~4 min ios 📦zip
✔️ fab6ab3 #4 2024-04-24 12:48:07 ~4 min android 📦aar
✖️ 962a8d9 #5 2024-04-25 02:08:56 ~1 min tests 📄log
✔️ 962a8d9 #5 2024-04-25 02:11:17 ~3 min linux 📦zip
✔️ 962a8d9 #5 2024-04-25 02:11:30 ~4 min ios 📦zip
✔️ 962a8d9 #5 2024-04-25 02:12:20 ~5 min android 📦aar
✖️ acc4d2d #6 2024-04-25 02:10:43 ~1 min tests 📄log
✔️ acc4d2d #6 2024-04-25 02:14:09 ~2 min linux 📦zip
✔️ acc4d2d #6 2024-04-25 02:15:11 ~2 min android 📦aar
✔️ acc4d2d #6 2024-04-25 02:15:40 ~3 min ios 📦zip
✖️ f184645 #7 2024-04-25 02:26:43 ~1 min tests 📄log
✔️ f184645 #7 2024-04-25 02:27:45 ~2 min linux 📦zip
✔️ f184645 #7 2024-04-25 02:27:51 ~2 min android 📦aar
✔️ f184645 #7 2024-04-25 02:29:12 ~3 min ios 📦zip
✖️ e1aa5c1 #8 2024-04-25 02:28:09 ~1 min tests 📄log
✔️ e1aa5c1 #8 2024-04-25 02:29:46 ~1 min android 📦aar
✔️ e1aa5c1 #8 2024-04-25 02:30:09 ~2 min linux 📦zip
✔️ e1aa5c1 #8 2024-04-25 02:33:24 ~3 min ios 📦zip
✖️ b1dfd4c #9 2024-04-25 02:33:11 ~1 min tests 📄log
✔️ b1dfd4c #9 2024-04-25 02:33:47 ~1 min android 📦aar
✔️ b1dfd4c #9 2024-04-25 02:34:22 ~2 min linux 📦zip
✔️ b1dfd4c #9 2024-04-25 02:37:12 ~3 min ios 📦zip
✖️ 9d35ade #10 2024-04-25 09:51:12 ~1 min tests 📄log
✔️ 9d35ade #10 2024-04-25 09:52:11 ~2 min android 📦aar
✔️ 9d35ade #10 2024-04-25 09:52:16 ~2 min linux 📦zip
✔️ 9d35ade #10 2024-04-25 09:53:26 ~3 min ios 📦zip
✔️ 6fe326b #11 2024-04-25 16:12:15 ~1 min android 📦aar
✔️ 6fe326b #11 2024-04-25 16:12:55 ~2 min linux 📦zip
✔️ 6fe326b #11 2024-04-25 16:13:57 ~3 min ios 📦zip
✖️ 6fe326b #11 2024-04-25 16:55:48 ~45 min tests 📄log
✖️ 6fe326b #12 2024-04-25 21:57:12 ~44 min tests 📄log
✔️ 212eebc #12 2024-04-26 10:39:50 ~3 min ios 📦zip
✔️ 212eebc #12 2024-04-26 10:40:48 ~4 min linux 📦zip
✔️ 212eebc #12 2024-04-26 10:42:06 ~5 min android 📦aar
✖️ 212eebc #13 2024-04-26 11:16:24 ~40 min tests 📄log
✖️ 212eebc #14 2024-04-29 08:28:41 ~39 min tests 📄log
✖️ 04dd0f8 #15 2024-04-30 08:07:29 ~1 min tests 📄log
✔️ 04dd0f8 #13 2024-04-30 08:07:47 ~1 min android 📦aar
✔️ 04dd0f8 #13 2024-04-30 08:08:28 ~2 min linux 📦zip
✔️ 04dd0f8 #13 2024-04-30 08:09:44 ~3 min ios 📦zip
✖️ 407fbd3 #16 2024-05-08 20:26:04 ~2 min tests 📄log
✔️ 407fbd3 #14 2024-05-08 20:27:15 ~3 min linux 📦zip
✔️ 407fbd3 #14 2024-05-08 20:28:51 ~5 min ios 📦zip
✔️ 407fbd3 #14 2024-05-08 20:29:18 ~6 min android 📦aar
✔️ d9170f0 #15 2024-05-08 20:36:09 ~2 min linux 📦zip
✔️ d9170f0 #15 2024-05-08 20:37:31 ~3 min ios 📦zip
✔️ d9170f0 #15 2024-05-08 20:39:25 ~5 min android 📦aar
✔️ d9170f0 #17 2024-05-08 21:15:38 ~41 min tests 📄log
✔️ 3dde1e8 #16 2024-05-08 23:58:23 ~3 min ios 📦zip
✔️ 3dde1e8 #16 2024-05-08 23:58:53 ~3 min linux 📦zip
✔️ 3dde1e8 #16 2024-05-09 00:00:41 ~5 min android 📦aar
✔️ 3dde1e8 #18 2024-05-09 00:38:05 ~43 min tests 📄log
✔️ 295db89 #17 2024-05-09 08:11:14 ~2 min android 📦aar
✔️ 295db89 #17 2024-05-09 08:11:24 ~2 min linux 📦zip
✔️ 295db89 #17 2024-05-09 08:12:29 ~3 min ios 📦zip
✖️ 295db89 #19 2024-05-09 08:43:58 ~35 min tests 📄log
✔️ 8499cab #18 2024-05-09 18:37:35 ~2 min linux 📦zip
✔️ 8499cab #18 2024-05-09 18:37:42 ~2 min android 📦aar
✔️ 8499cab #18 2024-05-09 18:38:30 ~3 min ios 📦zip
✖️ 8499cab #20 2024-05-09 19:09:56 ~34 min tests 📄log
✖️ 8499cab #21 2024-05-09 19:52:31 ~35 min tests 📄log
✔️ 7e72ab1 #19 2024-05-09 20:18:14 ~2 min linux 📦zip
✔️ 7e72ab1 #19 2024-05-09 20:18:29 ~2 min android 📦aar
✔️ 7e72ab1 #19 2024-05-09 20:19:20 ~3 min ios 📦zip
✖️ 7e72ab1 #22 2024-05-09 20:50:52 ~34 min tests 📄log
✔️ 51cb49e #20 2024-05-09 21:03:24 ~2 min android 📦aar
✔️ 51cb49e #20 2024-05-09 21:03:51 ~2 min linux 📦zip
✔️ 51cb49e #20 2024-05-09 21:04:21 ~3 min ios 📦zip
✖️ 51cb49e #23 2024-05-09 21:36:09 ~35 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7d8f819 #21 2024-05-09 22:12:49 ~2 min linux 📦zip
✔️ 7d8f819 #21 2024-05-09 22:12:49 ~2 min android 📦aar
✔️ 7d8f819 #21 2024-05-09 22:13:24 ~3 min ios 📦zip
✔️ 7d8f819 #24 2024-05-09 22:52:42 ~42 min tests 📄log

@kounkou kounkou force-pushed the fix-activate-permissions-upon-making-device-controlnode branch 2 times, most recently from 67327a6 to cd10710 Compare April 19, 2024 07:59
@kounkou kounkou self-assigned this Apr 19, 2024
@kounkou kounkou requested a review from osmaczko April 19, 2024 08:02
Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

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

To reproduce the issue I would base on TestControlNodeUpdateSigner. I'll try to come up with a test scaffold for you today.

protocol/communities/manager.go Outdated Show resolved Hide resolved
protocol/communities/manager.go Show resolved Hide resolved
protocol/communities_events_utils_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

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

Thanks, other then some minor quality improvements, looks good.

@mprakhov can you please have a look?

protocol/communities_messenger_signers_test.go Outdated Show resolved Hide resolved
protocol/communities_messenger_signers_test.go Outdated Show resolved Hide resolved
protocol/communities_messenger_signers_test.go Outdated Show resolved Hide resolved
protocol/communities_messenger_signers_test.go Outdated Show resolved Hide resolved
protocol/communities_messenger_signers_test.go Outdated Show resolved Hide resolved
protocol/communities_messenger_signers_test.go Outdated Show resolved Hide resolved
protocol/communities/manager.go Outdated Show resolved Hide resolved
protocol/communities/manager.go Outdated Show resolved Hide resolved
@kounkou
Copy link
Contributor Author

kounkou commented Apr 29, 2024

Hi there,
I am changing my approach here to get this issue fixed ASAP.
I will just rely on the QA testing for now, and I will ignore the integration testing for now.

@kounkou kounkou force-pushed the fix-activate-permissions-upon-making-device-controlnode branch from 212eebc to 04dd0f8 Compare April 30, 2024 08:05
@kounkou kounkou force-pushed the fix-activate-permissions-upon-making-device-controlnode branch 3 times, most recently from d9170f0 to 3dde1e8 Compare May 8, 2024 23:54
@kounkou kounkou force-pushed the fix-activate-permissions-upon-making-device-controlnode branch from 3dde1e8 to 295db89 Compare May 9, 2024 08:08
@kounkou kounkou force-pushed the fix-activate-permissions-upon-making-device-controlnode branch 3 times, most recently from 7e72ab1 to 51cb49e Compare May 9, 2024 21:00
This PR mitigates permission stuck in pending state upon making device a
control node. It fixes [#14023](status-im/status-desktop#14023)
@kounkou kounkou force-pushed the fix-activate-permissions-upon-making-device-controlnode branch from 51cb49e to 7d8f819 Compare May 9, 2024 22:09
Copy link
Contributor

@MishkaRogachev MishkaRogachev left a comment

Choose a reason for hiding this comment

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

Changes look really solid!

@@ -71,6 +71,18 @@ const (
maxChunkSizeBytes = 1500000
)

const (
Copy link
Contributor

Choose a reason for hiding this comment

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

Kudos on keeping all the errors in one place!

@kounkou kounkou merged commit 627e23f into develop May 10, 2024
8 of 9 checks passed
@kounkou kounkou deleted the fix-activate-permissions-upon-making-device-controlnode branch May 10, 2024 15:56
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.

Permission created before making device a control node is not getting active
5 participants