Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-24356] Dispatch getChannelMemberCountsByGroup if timezones are enabled when user is updated #5357

Merged
merged 2 commits into from
Apr 30, 2020

Conversation

fmunshi
Copy link
Contributor

@fmunshi fmunshi commented Apr 20, 2020

Summary

  • Builds off of [MM 23264] Show Confirmation Modal for group mentions #5331 look at latest commit for my changes
  • Dispatch getChannelMemberCountsByGroup when a user updates is called in order to ensure timezone counts are accurate since a user may change their timezone resulting in the confirmation modal displaying out of date information if the page hasnt been reloaded in a while.

Ticket Link

@fmunshi fmunshi added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Apr 20, 2020
@fmunshi fmunshi requested review from mkraft and hahmadia April 20, 2020 17:57
@fmunshi fmunshi requested a review from hahmadia April 21, 2020 17:31
const config = getConfig(state);
const isTimezoneEnabled = config.ExperimentalTimezone === 'true';
const userIsGuest = isGuest(user);
if (userIsGuest || isTimezoneEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the background: why is this branching statement only for guests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure what the background was either but it just so happened I needed the same logic for getChannelMemberCounts... that was being done for guest users

});
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a hefty amount of logic in both create_post.jsx and create_comment.jsx, which makes sense but my only callout would be to consider if there's any opportunity for reuse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed @mkraft - but this PR never actually had changes to that file that was from Hosseins previous PR that this was built off of. Maybe we can make a ticket to cleanup and reduce duplication between the two files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah for sure. I was thinking this was new code. NVM then.

@fmunshi fmunshi removed the 2: Dev Review Requires review by a core commiter label Apr 25, 2020
@fmunshi fmunshi requested a review from srkgupta April 25, 2020 00:52
@fmunshi fmunshi added this to the v5.24.0 milestone Apr 25, 2020
Copy link
Contributor

@srkgupta srkgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the webapp makes a request to get the members_count_by_group whenever the Timezone information was changed by a different user. However while testing this PR, there was an another issue found which has been raised separately. https://mattermost.atlassian.net/browse/MM-24674.

Expecting a separate fix for that issue, since it's not related to the original ticket. Approving this PR.

@srkgupta srkgupta added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels Apr 30, 2020
@srkgupta srkgupta merged commit bdf0208 into mattermost:master Apr 30, 2020
@fmunshi fmunshi deleted the MM-24356-Timezone-count branch April 30, 2020 16:03
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation
Projects
None yet
5 participants