-
Notifications
You must be signed in to change notification settings - Fork 246
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_: community sync #5880
base: develop
Are you sure you want to change the base?
fix_: community sync #5880
Conversation
Jenkins Builds
|
Could you explain how we can reproduce it in 100%? @osmaczko |
There is no easy way to reproduce. I am trying to come up with integration test for the regression. |
communityDescriptionBytes, err := proto.Marshal(request.Community) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// We need to wrap `request.Community` in an `ApplicationMetadataMessage` | ||
// of type `CommunityDescription` because `UpdateCommunityDescription` expects this. | ||
// | ||
// This is merely for marsheling/unmarsheling, hence we attaching a `Signature` | ||
// is not needed. | ||
metadataMessage := &protobuf.ApplicationMetadataMessage{ | ||
Payload: communityDescriptionBytes, | ||
Type: protobuf.ApplicationMetadataMessage_COMMUNITY_DESCRIPTION, | ||
} | ||
|
||
appMetadataMsg, err := proto.Marshal(metadataMessage) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
isControlNodeSigner := common.IsPubKeyEqual(community.ControlNode(), signer) | ||
if !isControlNodeSigner { | ||
m.logger.Debug("signer is not control node", zap.String("signer", common.PubkeyToHex(signer)), zap.String("controlNode", common.PubkeyToHex(community.ControlNode()))) | ||
return nil, ErrNotAuthorized | ||
} | ||
|
||
_, processedDescription, err := m.preprocessDescription(community.ID(), request.Community) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
_, err = community.UpdateCommunityDescription(processedDescription, appMetadataMsg, nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if err = m.handleCommunityTokensMetadata(community); err != nil { | ||
return nil, err | ||
} | ||
|
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.
Hmm, don't we want to keep this around for 3 versions, until users upgrade?
(only process it if CommunityDescriptionMessage
is missing)
5bfb6df
to
6d88d06
Compare
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## develop #5880 +/- ##
===========================================
+ Coverage 45.78% 47.40% +1.61%
===========================================
Files 830 830
Lines 137660 137643 -17
===========================================
+ Hits 63034 65251 +2217
+ Misses 67300 64633 -2667
- Partials 7326 7759 +433
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Prevent community description message being stored without signature. Details: status-im/status-mobile#21303 (comment)
fixes: status-im/status-mobile#21303