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(manager)_: make sure to re-add revealed accounts in the response #5867

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jrainville
Copy link
Member

We remove the shared accounts to send normal admins to not leak the addresses, however, that was a destructive action that also removed them from the requestToJoin param, which is reused later in the code, so it created an unwanted side effect. The side effect is now erased.

@status-im-auto
Copy link
Member

status-im-auto commented Sep 23, 2024

Jenkins Builds

Click to see older builds (5)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 353dd36 #1 2024-09-23 20:14:12 ~2 min tests-rpc 📄log
✔️ 353dd36 #1 2024-09-23 20:15:45 ~4 min linux 📦zip
✔️ 353dd36 #1 2024-09-23 20:16:42 ~5 min ios 📦zip
✔️ 353dd36 #1 2024-09-23 20:17:19 ~5 min android 📦aar
✔️ 353dd36 #1 2024-09-23 20:43:47 ~32 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0b78473 #2 2024-09-24 18:33:38 ~2 min tests-rpc 📄log
✔️ 0b78473 #2 2024-09-24 18:35:07 ~4 min linux 📦zip
✔️ 0b78473 #2 2024-09-24 18:35:31 ~4 min android 📦aar
✔️ 0b78473 #2 2024-09-24 18:35:40 ~4 min ios 📦zip
✔️ 0b78473 #2 2024-09-24 19:02:26 ~31 min tests 📄log
✔️ 8cafbcb #3 2024-09-27 15:26:01 ~3 min ios 📦zip
✔️ 8cafbcb #3 2024-09-27 15:30:39 ~8 min tests-rpc 📄log
✔️ 8cafbcb #3 2024-09-27 15:31:01 ~8 min linux 📦zip
✔️ 8cafbcb #3 2024-09-27 15:33:37 ~11 min android 📦aar
✔️ 8cafbcb #3 2024-09-27 16:00:19 ~37 min tests 📄log

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2800 1 2799 29
View the full list of 1 ❄️ flaky tests
github.com/status-im/status-go/protocol TestMessengerCommunitiesTokenPermissionsSuite

Flake rate in main: 96.22% (Passed 16 times, Failed 407 times)

Stack Traces | 87.9s run time
=== RUN   TestMessengerCommunitiesTokenPermissionsSuite
2024-09-27T15:46:31.182Z	DEBUG	p2p-config	config/log.go:21	[Fx] HOOK OnStop		github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2.1() executing (caller: github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2)
2024-09-27T15:46:34.429Z	DEBUG	p2p-config	config/log.go:21	[Fx] HOOK OnStop		github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2.1() called by github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2 ran successfully in 4.168µs
2024-09-27T15:46:37.300Z	DEBUG	p2p-config	config/log.go:21	[Fx] HOOK OnStop		github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2.1() called by github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2 ran successfully in 6.001µs
2024-09-27T15:47:37.957Z	DEBUG	p2p-config	config/log.go:21	[Fx] HOOK OnStop		github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2.1() called by github..../libp2p/go-libp2p/config.(*Config).addAutoNAT.func2 ran successfully in 14.317µs
--- FAIL: TestMessengerCommunitiesTokenPermissionsSuite (87.89s)


To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@@ -922,6 +922,7 @@ func (s *MessengerCommunitiesSuite) TestRequestAccess() {
response, err = s.bob.AcceptRequestToJoinCommunity(acceptRequestToJoin)
s.Require().NoError(err)
s.Require().NotNil(response)
s.Require().Len(response.RequestsToJoinCommunity()[0].RevealedAccounts, 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better to prevent panics in tests as much as possible

Suggested change
s.Require().Len(response.RequestsToJoinCommunity()[0].RevealedAccounts, 1)
s.Require().NotEmpty(response.RequestsToJoinCommunity())
s.Require().Len(response.RequestsToJoinCommunity()[0].RevealedAccounts, 1)

We remove the shared accounts to send normal admins to not leak the addresses, however, that was a destructive action that also removed them from the `requestToJoin` param, which is reused later in the code, so it created an unwanted side effect. The side effect is now erased.
@jrainville jrainville force-pushed the fix/no-revealed-accounts-in-response branch from 0b78473 to 8cafbcb Compare September 27, 2024 15:22
@jrainville
Copy link
Member Author

@osmaczko reminder to review please

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.

4 participants