-
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
[CHERRY PICK] fix_: fill missing community tokens in controlled communities (#5154) #5188
Conversation
Needed for status-im/status-desktop#14679 On app start, fills controlled communities with missing deployed community tokens if there are.
@@ -481,6 +481,11 @@ func (m *Manager) Start() error { | |||
if m.ownerVerifier != nil { | |||
m.runOwnerVerificationLoop() | |||
} | |||
|
|||
go func() { | |||
_ = m.fillMissingCommunityTokens() |
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.
Just wondering if it makes sense to log something in case of error since fillMissingCommunityTokens
returns an error? Did you maybe anticipate this might be too verbose?
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.
I do all the logs directly in fillMissingCommunityTokens
. I could add an additional log here, but it would just repeat the error and lack the additional context.
@@ -513,6 +518,61 @@ func (m *Manager) runENSVerificationLoop() { | |||
}() | |||
} | |||
|
|||
// This function is mostly a way to fix any community that is missing tokens in its description | |||
func (m *Manager) fillMissingCommunityTokens() 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.
To me, this function looks hard to predict knowing that it's called in different go routines, but seems ok to me as well. I thought about using go channels as well, but it would require some deeper analysis.
…#5188) Needed for status-im/status-desktop#14679 On app start, fills controlled communities with missing deployed community tokens if there are.
Cherry pick of #5154
Needed for status-im/status-desktop#14679
On app start, fills controlled communities with missing deployed community tokens if there are.