-
Notifications
You must be signed in to change notification settings - Fork 250
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
Conversation
Jenkins BuildsClick to see older builds (5)
|
353dd36
to
0b78473
Compare
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky tests
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) |
There was a problem hiding this comment.
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
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.
0b78473
to
8cafbcb
Compare
@osmaczko reminder to review please |
@@ -4897,18 +4897,22 @@ func (m *Manager) ShareRequestsToJoinWithPrivilegedMembers(community *Community, | |||
return nil | |||
} | |||
|
|||
func (m *Manager) shareAcceptedRequestToJoinWithPrivilegedMembers(community *Community, requestsToJoin *RequestToJoin) error { | |||
pk, err := common.HexToPubkey(requestsToJoin.PublicKey) | |||
func (m *Manager) shareAcceptedRequestToJoinWithPrivilegedMembers(community *Community, requestToJoin *RequestToJoin) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (m *Manager) shareAcceptedRequestToJoinWithPrivilegedMembers(community *Community, requestToJoin *RequestToJoin) error { | |
func (m *Manager) shareAcceptedRequestToJoinWithPrivilegedMembers(community *Community, requestToJoin *const RequestToJoin) error { |
@ google can you please introduce this concept?
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.