Skip to content
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

Direct messages cause notification icons to appear on each team, which don't clear until clicked on each team #160

Closed
1 task done
leipert opened this issue Jun 8, 2016 · 9 comments

Comments

@leipert
Copy link

leipert commented Jun 8, 2016

  • Did you read CONTRIBUTING.md?

Hey @yuya-oc, we currently have the problem, that we have two teams with the same users.
So basically the unread count is increased in both teams, for every direct message.

Now that I found out, that you are getting the unread count by parsing html, would you be open to a PR with more direct approach and retrieving the unread count directly with the API?

Anyway, thank you for your work on the client. I would look forward to a possible collaboration.

/cc @crspeller @it33

@yuya-oc
Copy link
Contributor

yuya-oc commented Jun 9, 2016

Sure, currently the client parses html (btw, the part you linked is for 'unread channels'. The mention count is gotten from sidebar and mention-highlight).
Of course PR is welcome. However, probably that makes breaking change, so it might take long time to review. Then, unfortunately I don't know well about the API, so now I can't tell enough advise to implement.

@jasonblais
Copy link
Contributor

Thanks @leipert for the feedback. Very much appreciated,

We have a related issue that was recently opened in the /platform repo: mattermost/mattermost#3529. The team is open for suggestions on the expected behaviour when handling direct message lists across multiple teams. Feel free to add your thoughts by participating in the discussion.

@jasonblais
Copy link
Contributor

Adding repro steps from @jfpreusse-bhvr:

Summary

When receiving a direct message, a red notification icon is added to all tabs and can only be cleared by opening the message on each team.

Steps to reproduce

This is for the Windows Desktop Application version 1.3.0.

  • Open the Windows Desktop Application and make sure you have joined more than one team (you should have multiple tabs in the application).
  • Ask someone to send you a direct message.

Expected behavior

The direct message notification icon should be displayed on one team only (e.g. the main team on the server, or make this a user preference), or at least be cleared for all tabs when read on one of the teams.

Observed behavior

The direct message notification icon is displayed on all the teams. The user must open the message in each team for all notification icons to be cleared.

@jasonblais jasonblais changed the title Use Mattermost API for unread counts, etc. Direct messages cause notification icons to appear on each team, which don't clear until clicked on each team Aug 17, 2016
@drmikecrowe
Copy link

So, in taking a cursory look at this, is there a reason to map the notifications to all teams rather than just the first team? i.e.

src/browser/index.jsx:

var views = this.props.teams.map(function(team, index) {
      if (index > 0) return;        // only send to the first team????
      var handleUnreadCountChange = function(unreadCount, mentionCount, isUnread, isMentioned) {
        thisObj.handleUnreadCountChange(index, unreadCount, mentionCount, isUnread, isMentioned);
      };
      var handleNotificationClick = function() {
        thisObj.handleSelect(index);
      }
      var id = 'mattermostView' + index;
      var is_active = thisObj.state.key === index;
      return (<MattermostView key={ id } id={ id } style={ thisObj.visibleStyle(is_active) } src={ team.url } name={ team.name } onUnreadCountChange={ handleUnreadCountChange }
                onNotificationClick={ handleNotificationClick } ref={ id } active={ is_active } />)
    });

@yuya-oc
Copy link
Contributor

yuya-oc commented Aug 30, 2016

For earlier mattermost servers, it was necessary because users were separately managed by each team even if they exist in the same server.

Then, the code you pointed is the wrong part. views is actually an array of <webview> and they just report their unread counting. The appearance of counting is managed by <Tabbar> component. Sure, the simple mapping causes this problem, so need to organize the counting.

@jasonblais
Copy link
Contributor

Mattermost has a feature in review where teams belonging to the same server would appear on the sidebar, left of the channels.

image

I think once the sidebar for teams gets implemented, we can much more easily streamline how notifications across teams work. Hence, adding a Pending label to this issue for now

@jasonblais
Copy link
Contributor

Adding server label as this is blocked by the teams sidebar on the server side.

@jfperusse-bhvr
Copy link

Adding my suggestion from the closed issue 3529.

Here's how I think this should work. This is one of the most annoying issue for us since we're all part of multiple teams.

Suppose that:

  • User A is part of teams X and Y (default team is X)
  • User B is part of teams X and Z (default team is X)

What should happen:

  • When user A writes to User B from team X, User B should receive the notification under team X.
  • When user A writes to User B from team Y, User B should receive the notification under team X (his default team).

To me this makes a lot of sense since I generally talk to another user from the team which makes the most sense for the topic I want to discuss.

@jasonblais
Copy link
Contributor

jasonblais commented Jan 13, 2017

@leipert @drmikecrowe @jfperusse-bhvr This issue should be resolved in Mattermost 3.6 with the new multi-deployment support through team sidebar. The release will be on January 16th.

With the new release, all of your teams will be visible on the left-hand sidebar as an additional team, and therefore you no longer need a separate tab for each team.

To update your team management tabs, simply go to File > Settings or click Ctrl+Comma on your keyboard to visit the App Settings page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants