-
Notifications
You must be signed in to change notification settings - Fork 2.7k
MM-50576 Remove most places where a selector factory isn't reused properly #12230
Conversation
E2E tests not automatically triggered, because PR has no approval yet. Please ask a developer to review and then try again to attach the QA label. |
/e2e-tests |
Successfully triggered E2E testing! |
Comparing those E2E test results against https://mattermost-cypress-report.s3.amazonaws.com/304278-onprem-ent-master-mm-ee-test:test/mochawesome.html, none of those test failures seem to be exclusive to this PR |
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.
Scanning through the change, I can confirm the only changes are to factor out the selector factories and that the changes match the purposes and expectation of https://react-redux.js.org/api/connect#factory-functions . After manual smoke testing, it also seems like everything still works as expected. LGTM, thanks @hmhealey !
const rhsState = getRhsState(state); | ||
if ( | ||
rhsState !== RHSStates.PIN && // Not show in pinned posts since they are all for the same channel | ||
!isDMorGM && // Not show for DM or GMs since they don't belong to a team |
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.
Variable name makes me think of De Morgans' laws, more so because its used in a bunch of chained logic statements 😄
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.
Oh boy. It's been a while since I've thought of De Morgans' laws 😅
Test server creation failed. See the logs for more information. |
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.
💯
/e2e-tests |
Successfully triggered E2E testing! |
I looked over the E2E results, and the only test that isn't failing on this nightly run or flaky is |
You don't have permissions to trigger this command. |
There's a few places where we're improperly using selector factories and creating new instances of those selectors whenever anything in the store changes. This is exacerbating some other performance issues we're investigating since 5-20% of the time taken during certain actions is being spent on making new selectors.
The ones that are changed here are:
makeGetThreadOrSynthetic
(used byDotMenu
andRhsHeaderPost
)makeIsPostCommentMention
(used byPost
)makeGetCommentCountForPost
(used byPost
andDotMenu
)makeGetCategory
(used byOverageUsersBanner
andDelinquencyModal
)makeGetUserTimezone
is mentioned in that screenshot above, but it'll be fixed in a followup PR.Ticket Link
https://mattermost.atlassian.net/browse/MM-50576
Related Pull Requests
#12231
Release Note