Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • in the notification phase, when the aggregated number of group members to mention is above 5 a certain threshold, we are showing a warning modal  (see wireframe), the text message in the modal includes the user count from the largest group in the collection. This is a compromise solution, due to performance constraints - fetching the accurate count, including membership overlaps, from the server would introduce a delay in sending the notification.

  • If more than 5 members of a group exist in the channel that the group being mentioned, the user will get a warning modal mentioning that they will be notifying the group with the most number of members within that channel. For example, if we mention @developers and @board and @developer , where @developers has 10 users within the channel while @board only has 2 members in the channel, the warning modal will explain that you are about to notify @developers and @board with 10 members in the channel. We were unable to display the accurate number of users being notified due to the bottleneck of trying to avoid duplicates since a user can be found in multiple groups. If a group has a repeating user and requiring to find the UNION of all the group members within the channel would cause significant performance degrade which is why we opted to go with the alternate solution of displaying the maximum number of users being notified within a groupIf two groups have repeating users the total count shown by the dialog would have to be the intersection of members for each group within the channel. This would cause a significant performance regression and cannot be done for the MVP.

Future work: Investigate a better solution?

...

  • The markdown component will be modified to use getAllUserMentionKeys which contains the union of `getCurrentUserMentionKeys and getCurrentUserGroupMentionKeys. This will ensure that group names will be highlighted for the user as expected.

  • The web app filters all the mentions and compares it to the allow_reference groups available through redux to see which ones are being mentioned. In the redux state, when you visit a channel, existing admin setting enableConfirmNotificationsToChannel will be used to determine if the warning modal should show up if a group has more than 5 members in the channel.

  • Upon visiting a channel all the groups that have members within that channel are will now be available in state.entities.channelMemberCountsByGroup[channelID]. channelMemberCountsByGroup selector.

  • A utility function groupsMentionedInText will be added to get all the groups mentioned in a message before sending.

  • All the groups being mentioned will be retrieved from the state and then the one with the most channel members will be grabbed and used to display the number of users being notified. However, if groups are being mentioned alongside @all or @channel, then the total number of channel members - 1 will be used instead.

...

  • A new selector will be added to get the list of groups that the current user can be mentioned by: getCurrentUserGroupMentionKeys this will be used to determine which @group mentions should be highlighted in the chat facing UI. This selector will be used inside of getAllUserMentionKeys to return the result merged with getCurrentUserMentionKeys (which contains regular mentions such as first name / user name etc).

  • In the redux side of things, a new function getChannelMemberCountsByGroup has New actions and selectors for getChannelMemberCountsByGroup have been added which takes take a channelID and a boolean includeTimezones and , returns a list of all groups with members within the channel and number of members in that channel. If includeTimezones is true then we the function also get returns the different number of unique timezones amongst for the users in that group. This information is used by the web app to determine which group has the most number of users in the channel to for displaying the number of users being notified after the message has been sent.

REST API

we will add the following new endpoints:

...