-
Notifications
You must be signed in to change notification settings - Fork 2.7k
MM-18775: Remove some deprecated/unsafe lifecycles #4903
Conversation
@@ -62,9 +60,9 @@ export default class PermissionSchemesSettings extends React.PureComponent { | |||
promises.push(this.props.actions.loadSchemeTeams(scheme.id)); | |||
} | |||
Promise.all(promises).then(() => this.setState({loading: false, phase2MigrationIsComplete})); |
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.
what happens if setState throws? Is it being caught by the outer catch()? According to this: https://twitter.com/dan_abramov/status/770914625206583296 ; "then(a).catch(b) makes errors from a go to b". Are we ok with it here (and if yes, should phase2MigrationIsComplete be true?).
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.
This replicates the same behavior than the previous one, I think we can create another ticket here to address the possible swallowing of failures in the Promise.all().then
line, probably we should catch and decide what to do there. But I think is not in the scope of this PR because this is about the migration of UNSAFE
methods.
@catalintomai What do you think about creating another ticket for better error handling on this components and keep this PR only for the migration from UNSAFE
methods?
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.
Sure, will do.
/update-branch |
Thanks @jespino I did some smoke-testing around permissions and LDAP groups but this will need to be tested more thoroughly by @srkgupta and @DHaussermann post-merge. Is it possible to add unit / cypress tests for these changes? |
Hi @jespino - should a cypress / unit test be added for this? |
@lindy65 I think it is a bit out of the scope here. We are not changing any behavior, we are just maintaining the old behavior. We can add some cypress tests, but I would create another ticket for that. |
/update-branch |
Mattermost test server updated with git commit Access here: https://mattermost-webapp-pr-4903.test.mattermost.cloud |
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.
Thanks @jespino - sounds good to me to forego the cypress/unit test then 👍
Test server destroyed |
Co-authored-by: mattermod <[email protected]>
Summary
Remove some deprecated/unsafe lifecycles (mainly related to enterprise related parts of the code)
Ticket Link
MM-18775