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

Click on notification doesn't redirect to the right tab (team) #321

Closed
4 tasks done
guyguy333 opened this issue Sep 28, 2016 · 13 comments
Closed
4 tasks done

Click on notification doesn't redirect to the right tab (team) #321

guyguy333 opened this issue Sep 28, 2016 · 13 comments

Comments

@guyguy333
Copy link


Summary

When you get a notification with a new message and you click on it, instead of switching to the right tab (team) in the desktop app, it changes the team in the previously active team (tab).

Steps to reproduce

Operating System: OS X 10.11.6
Mattermost Desktop App version: 3.4.0
Mattermost Server version: 3.4.0

Adds two teams to Mattermost desktop. Each team appears in a different tab in the desktop app. Select a tab and wait a notification from the other team. Click on it. The tab will not change, it will instead switch team in the current tab.

Expected behavior

When you click on the notification, it should switch tab focus instead of changing team in the current tab.

Observed behavior

Currently, it changes team in the tab (leading to two tabs with the same team) who you click on the notification.

@jasonblais
Copy link
Contributor

Not reproduced on Windows 10, known issue in Windows 7.

I thought this behaviour used to work for OS X though, so adding a bug label for it,

@yuya-oc
Copy link
Contributor

yuya-oc commented Sep 28, 2016

@guyguy333 To make sure, would you check whether you are using the latest release? v3.4.0-rc1 had a bug which is related to notifications. If you are using correct version, please show console output when clicking notifications (Alt+Cmd+I shows the console).

@St-Ex
Copy link
Contributor

St-Ex commented Sep 29, 2016

Same problem on linux Mint 18. When clicking on notification, current tab switch to team/channel instead of relevant tab switching to channel.

@jasonblais
Copy link
Contributor

Did it use to work for you @St-Ex and @guyguy333, or is this a new problem with Desktop App v3.4?

Also, if you're able to provide a console output, that would be great:

  1. In the Mattermost Desktop App, open developer console Ctrl+Shift+I on Windows/Linux, Alt+Cmd+I on Mac)
  2. Choose Console on the developer console

image

  1. Switch to [Team1] on the Desktop App
  2. Switch to another app/browser on your machine
  3. Receive a message from someone in [Team2]
  4. Click on the desktop notification

This should print messages on the developer console, which will make it easier for us to troubleshoot the problems.

@St-Ex
Copy link
Contributor

St-Ex commented Sep 29, 2016

I don't remember this ever working. This seems to happen when the desired channel doesn't exist on the current tab. This works correctly with direct message if your mate is on both team.

In fact there is no stack trace. But the current tab is switching toward the teams which contains the notificated channel.

Here a more detailed exemple

  1. I have 2 tabs
    1. FOO contains _team foo_ page
    2. BAR contains _team bar_ page
  2. I'm on tab FOO
  3. I receive a notification from _team bar_ channel bar-channel
  4. I click on the notification
  5. FOO tab now show _team bar_ page, on channel bar-channel

@St-Ex
Copy link
Contributor

St-Ex commented Sep 29, 2016

I think the problem is on index.jsx

var handleNotificationClick = function() {
        thisObj.handleSelect(index);
      }

We do not look for the tab to select. However, it will be hard because we have to change the notification onclick event to add the notification url but we don't have it. It's inside the chorme notification itself.

@yuya-oc
Copy link
Contributor

yuya-oc commented Sep 29, 2016

Hmm...the feature works fine in my Mac.

index.jsx is surely complicated. index is passed from prop.teams.map(), so it should open correct tab when it's called. For this purpose, Notification.onclick has been already changed in src/browser/webview/mattermost.js and src/browser/js/notification.js. It works like below.

  1. Click a notification.
  2. Call modified onclick event.
  3. The event calls handleNotificationClick() via some callbacks.
  4. Finally, call the original onlick event which is set by mattermost webapp.

Please let me confirm, does the two teams exist on the same server? Or different servers? In my app, there are two teams:

  1. team1 on server1
  2. team2 on server2

@St-Ex
Copy link
Contributor

St-Ex commented Sep 29, 2016

Both on same server.

I just discovered something. I add some logs after notification :

notification: function(title, options) {
    ipc.send('notified', {
      title: title,
      options: options
    });
    console.dir('notification-log',this)
  },

I can clearly see 2 notifications, on per tab being log
index.js:520 [SFAM] notification-log
index.js:520 [B-APPLI] notification-log

@St-Ex
Copy link
Contributor

St-Ex commented Sep 29, 2016

Exactly the same problem occurs with to firefox tab opened on 2 different team from the same server. I will open an issue on mattermost/plateform.

Exact problem is : receiving notification from another team on the same server

@St-Ex
Copy link
Contributor

St-Ex commented Sep 29, 2016

@jasonblais
Copy link
Contributor

Much appreciated, thanks @St-Ex!

@jasonblais
Copy link
Contributor

Jira ticket was created by the Mattermost team to fix on the server side, adding here for us to track: https://mattermost.atlassian.net/browse/PLT-4334

@jasonblais
Copy link
Contributor

@guyguy333 This issue is resolved in Mattermost Server 3.6, which will release on January 16th.

Thanks for all your help @St-Ex !

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

4 participants