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

Notifications for chats are not showing when browser tab/window is inactive #1575

Closed
jcastang opened this issue Feb 22, 2019 · 51 comments · Fixed by #10544
Closed

Notifications for chats are not showing when browser tab/window is inactive #1575

jcastang opened this issue Feb 22, 2019 · 51 comments · Fixed by #10544
Assignees
Labels

Comments

@jcastang
Copy link

jcastang commented Feb 22, 2019

Steps to reproduce

  1. Join a chat and stay in room but change browser tab
  2. Make someone in the room send you a message
  3. No notification raised

Expected behaviour

As the browser tab or window is not active, user should be marked as inactive and the receive notification.

Actual behaviour

No notification is raised because of user not being marked "inactive" on window change.
So you are to miss all messages from other until you go back to Nextcloud talk tab/window

I removed many of items asked in this bug in order to keep it clear. Those were not revelant.

If you miss any information, please feel free to ask.

Browser ALL

Operating system: Ubuntu
Browser name: Firefox/Chrome

Browser version: 65 for Firefox

Spreed app

Spreed app version: 5.0.2

Custom TURN server configured: yes

Custom STUN server configured: no

Operating system: Ubuntu

Web server: Apache

Database: Maria

PHP version:

Nextcloud Version: 15.0.4

@nickvergessen
Copy link
Member

Yeah, that is currently done intentionally, but we start to feel we should try to solve this in another way. But we also want to not pop notifications all the time when you are actively monitoring the chat on one device.

@jcastang
Copy link
Author

jcastang commented Feb 25, 2019

Yes I know this could be annoying.
As a user:

  • No notification if I am on Chat tab/window
  • Notifications if window/tab is inactive if fine.

Maybe make a notification on window title or tab title is fine too.

@nickvergessen nickvergessen self-assigned this Apr 10, 2019
@putt1ck
Copy link

putt1ck commented May 7, 2019

I think an approach where user focus is or appears to be on interaction with the chat means no notification but all other scenarios gets a notification i.e. on a desktop cursor is in the chat response box (and the tab/window is active) for that chat, in touch environment the device is active (unlocked) and the chat app is not backgrounded (including sharing the screen) and that chat is active. Any other situation needs a notification or the chat will be missed.

Q. if someone is logged into the NC instance but doesn't have chat open do they get notified in some way that's even a little intrusive?

@nickvergessen
Copy link
Member

if someone is logged into the NC instance but doesn't have chat open do they get notified in some way that's even a little intrusive?

They receive Browser notifications if accepted once.

@putt1ck
Copy link

putt1ck commented May 7, 2019

We're struggling to reproduce notifications. We get the little red dot on the bell in an NC tab, but nothing if you're not viewing the tab. The browser shows "send notifications Allowed" for the NC instance. Is there anywhere we should look to see related errors?

@georgehrke
Copy link
Member

We're struggling to reproduce notifications. We get the little red dot on the bell in an NC tab, but nothing if you're not viewing the tab. The browser shows "send notifications Allowed" for the NC instance. Is there anywhere we should look to see related errors?

The same for me. I was never asked for a permission to receive notifications and i also don't receive any.

But we also want to not pop notifications all the time when you are actively monitoring the chat on one device.

We should just use the same setting that's already there and show notifications based on the users choice.

8831CFFB-7B53-4222-8CC9-A0299595C021

@putt1ck
Copy link

putt1ck commented Jun 2, 2019

We're still struggling to get some notification of a chat being started or a message sent. We've tried with multiple installations and different browsers, and with setups that have STUN and TURN servers just to make sure we're covered our bases. Any idea where we can look now?

@stratoss
Copy link

stratoss commented Jul 6, 2019

They receive Browser notifications if accepted once.

@nickvergessen even the browser notifications are delayed, sometimes up to 5 minutes, which doesn't do the job.

I have deployed Talk as a Skype replacement in the company I work for, and the lack of proper notifications is forcing us to use jabber/phone to say "Hey, I wanna share my screen with you, can you please check the call I just initiated with you?" which... isn't how it is supposed to be.

We are willing to donate some amount of money if that is going to speed-up the development for reliable notifications.

@nickvergessen
Copy link
Member

I'm currently thinking, if we should send the notifications even when you are in the conversation and only mark them automatically read after 30 seconds. This way they would still pop in the browser, while not being left behind as a list of things that has been dealt with already.

@stratoss
Copy link

stratoss commented Aug 6, 2019

That would be nice. I would also suggest to have some non-annoying 'Blip' sound on received message, as well as updated tab title like 'X new messages... | Talk'.

Maybe even favico.ico replacement to attract more attention.

@nickvergessen
Copy link
Member

Unread count in title is handled in #798
Automatic playing of audio is currently not possible because chrome and firefox prevent this.

@putt1ck
Copy link

putt1ck commented Aug 20, 2019

@nickvergessen sound seems to work with other browser based chat systems. Or at least Google's. What would prevent NC from adopting a similar solution?

@nickvergessen
Copy link
Member

The sound option of web notifications was unsupported by all browsers and has now even be removed completly:
nextcloud/notifications#116

Also other "auto playing of audio" is prevented by firefox and chrome. So you can only play sound once the user interacted with the media element.

@stratoss
Copy link

stratoss commented Aug 20, 2019

@nickvergessen I've tested the audio tag and it works without any interaction on both Firefox (60.7) and Chrome (73).

proof of concept

Can't we trigger such play event on a new notification ? That would also fix #1444 .

@putt1ck
Copy link

putt1ck commented Aug 20, 2019

@stratoss does require the user first allows autoplay for the site (FF) but that's the same for notifications anyway.

@stratoss
Copy link

Hm Firefox says that no special permissions has been granted for that page, but yes, even if that's the case, audio notifications will greatly improve the UX.

@mcnesium
Copy link

please make those audio notifications opt-in 😨

@stratoss
Copy link

stratoss commented Nov 19, 2019

@nickvergessen are there any plans to introduce real-time noticeable notifications on new call / new message ? It is a basic functionality which all major web-based communication apps already support.

@nickvergessen
Copy link
Member

Yes of course.

A first step was done with #2438 for #798
The missing part is to detect the "window is inactive" case and still trigger call notifications in that case. This is what this issue is for.

@theoneandonly-vector
Copy link

theoneandonly-vector commented Mar 22, 2022

it really is, the mobile app can do notifications correctly since quite some time now. but on Desktop/web it's just not working at all.
it's especially sad if you see how it improved otherwise the last two years.

@Mer0me
Copy link

Mer0me commented Jun 10, 2022

If it can help someone, here is what I figure out today on our instance :
Talk notifications were nearly never showed to any client, neither on the web app nor on mobile.
The client_push App was installed and configured a while ago, but for some reason push binary wasn't running.

The command sudo -u www-data ./occ notification:test-push --talk someuser
didn't throw any error :

Trying to push to 1 devices

Language is set to fr
Private user key size: 1704
Public user key size: 451
Identified 1 Talk devices and 0 others.

Device token:43065
Device public key size: 451
Data to encrypt is: {"nid":18000,"app":"admin_notification_talk","subject":"Testing push notifications","type":"admin_notifications","id":"62a33f4b"}
Signed encrypted push subject
Push notification sent successfully

But notifications were displayed several minutes later, when it was working.

Running systemctl enable --now notify_push seems to solve the problem and notifications are now displayed instantly.

Maybe the client_push app should warn somewhere if the notify_push daemon is not running ?

@Refhi
Copy link

Refhi commented Sep 30, 2022

Steps to reproduce

1. Join a chat and stay in room but change browser tab

2. Make someone in the room send you a message

3. No notification raised

Expected behaviour

As the browser tab or window is not active, user should be marked as inactive and the receive notification.

Actual behaviour

No notification is raised because of user not being marked "inactive" on window change. So you are to miss all messages from other until you go back to Nextcloud talk tab/window

I'm having exactly the same behavior issue :

  • usually (thanks to notify_push) all talk notifications works perfectly on whatever device/application/desktop sync client etc.
  • But if a browser tab is opened on "spreed", the notifications are disabled, even if the tabs are inactive. Which is a pain for my coworkers who forget to close the tabs and miss the future messages :-/

How can I help solving this issue ?

@nickvergessen
Copy link
Member

Ref from slack:
https://twitter.com/vponamariov/status/1582671678328344576?t=J3nyvRvMgakV4fF8_DCGCA&s=19

image

@Fantu
Copy link

Fantu commented Dec 28, 2022

Hi, I did some tests on nextcloud 25 and I saw that message arrive "instantly" only if the recipient has the chat window open, out of that generate the notification on any nextcloud page loaded by the user but never if user do nothing (seems not processed including background operation by cron)
I also tested on other server with latest nextcloud 22 and is the same relating the notification never generate on users that have nextcloud page open but do nothing.
Is there something I not found or this will be possible only when this features will be developed?
Thanks for any reply and sorry for my bad english.

@urbenlegend
Copy link

I am running into this issue even on Nextcloud Hub 27. I miss a ton of messages because of this. If the chat is open but in an inactive tab, it should notify. If the worry is that other devices will ping even though a device has the chat active, maybe that device should send some kind of signal back to the server saying, hey, don't send notifications out to the other devices because its active in at least one device right now.

...although personally, given that my daily workflow consists of me moving between multiple devices frequently, I actually would prefer other devices notify me anyways even if one of my devices has it active.

@nickvergessen
Copy link
Member

nickvergessen commented Sep 20, 2023

💭 Discussion result from the Contributor week

  • A new endpoint to say "this sessions is no longer blocking notifications" or "this session is blocking notifications"
  • Browser and desktop client will use "Page Visibility API" and call the endpoint accordingly:
    • hidden => "this sessions is no longer blocking notifications"
    • visible => "this session is blocking notifications"
    • While visible there will be like a "dead man switch", after 180 sec of no interactions (mouse movement, browser blur/focus) the browser will still opt-out by sending "this sessions is no longer blocking notifications"
      • the idea of this is to send messages again in case the browser is not in the foreground or the user left the device, etc. while also not trying to annoy the users too much, in case they have Talk on Screen1 and currently work in another program on Screen2, while still reading/seeing Screen1 all the time.
  • Mobile apps could use this new API as well to stop leaving the conversation when a user is quickly switching to another app to copy some content, etc.

@msartiano
Copy link

@nickvergessen this is amazing news, thanks for sharing!
Can the "dead man switch" variable be changed on the settings, for example to lower inactivity time to 30 seconds, or set to 0 to always send notifications to devices?

@nickvergessen
Copy link
Member

for example to lower inactivity time to 30 second

The problem is it's not only "inactivity", but also inactivity in this window. If you have multiple screens, have the call with chat open on screen 1 and write a protocol on screen 2, it will mark you as inactive after 30 sec and you recent notifications all the time, making your phone, tablet, desktop client and browser ping you with notifications, while you are actually actively participating in the call. This is why for now we want to check it with 3 minutes.

@poiNt3D
Copy link

poiNt3D commented Oct 6, 2023

I don't think checking if the window is inactive for an amount of time is a good solution for the problem.
What if a user has just switched to another window, does that mean he doesn't receive notifications until this period has passed?
In any case, too much notifications is better than missed notifications. Imagine missing a message from your boss.

@nickvergessen
Copy link
Member

I don't think checking if the window is inactive for an amount of time is a good solution for the problem.
What if a user has just switched to another window, does that mean he doesn't receive notifications until this period has passed?

Yes, the problem is it would trigger too often otherwise.

Please see the above explanation.

while also not trying to annoy the users too much, in case they have Talk on Screen1 and currently work in another program on Screen2, while still reading/seeing Screen1 all the time.

This is the case for me multiple hours every day.
I always have Talk calls and chat on one screen and code on the other screen. Even through I actively see the chat and can read it, you would want me to receive a notification on:

  • My phone
  • My tablet
  • My desktop client
  • The native browser => piped to OS

This is way too much. So for now we will try this intermediate step

@poiNt3D
Copy link

poiNt3D commented Oct 6, 2023

If the chat window is open then the person can see the message - this is too much of an assumption. The chat window can be obscured by other windows, another tab could be open, even the person can be away from the computer.
I think the right way to handle this would be considering the message read status. If the message is unread for an X amount of time - generate notification. It's a simple and transparent for users solution.
The fact that notifications are arriving on all devices at once is out of the scope of Talk, in my opinion.
Probably it could be solved by detecting which of the devices a person has used last, and make notification sound only there.
Also, it could be made configurable.

@nickvergessen
Copy link
Member

another tab could be open

This is detectable and handled and the browser will immediately say "Ignore me and send notifications"

I think the right way to handle this would be considering the message read status. If the message is unread for an X amount of time - generate notification. It's a simple and transparent for users solution.

Well same issue. What does read mean? The chat scrolls automatically when the window is open and focused, "even the person can be away from the computer".

Please just await the next version and then we can see how it works.

@urbenlegend
Copy link

Please just await the next version and then we can see how it works.

Has a patch for this already been released as of 17.1.3? I am still missing messages.

@nickvergessen
Copy link
Member

No, we are not backporting this. It will come with Talk 18 for Nextcloud 28 in ~10 days

@ER-EPR
Copy link

ER-EPR commented Mar 12, 2024

Talk desktop client still no notification capabilities, why is that?

@Antreesy Antreesy modified the milestones: 💔 Backlog, v18.0.0-beta.1 Apr 27, 2024
@9joshua
Copy link

9joshua commented Jun 3, 2024

@nickvergessen Should this issue be closed? For me on Desktop the notification is suspended until the Spreed tab is focused - defeating the purpose of the notification.

@nickvergessen
Copy link
Member

Yes, it's fixed as good as possible atm.
For further info follow nextcloud/notifications#1946

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