Failed to construct 'Notification': Illegal constructor

Can I bump this and ask the same question - what is causing these log messages?

This appears as a warning in the logs, but the failed to construct message suggests that it should have been a failure.

Background

I’m trying to find the source of an insidious bug on our live system and just want to be able to tick this off the list as not being the cause.

The issue usually presents itself on desktop with multiple tabs open, something is updated (post, like, message) in another tab and the tab you’re in ‘dies’.

Something is causing the browser’s message bus to die which results in the topic’s footer disappearing and the user is left looking at the last post in the topic with no new notifications automatically appearing.

Finding the source of this is proving difficult. I thought I’d removed the plugin(s) that might be responsible but a couple of users are reporting that the issue is still there.

The only thing that I can see in the logs for the time period when they saw the issue is a number of messages about failing to construct Notification.

What have I found about this?

This post on stackoverflow…

…and the referenced chromium bug report, suggests that there is a difference between desktop and mobile Chrome in the way that notifications are handled - and perhaps there is a deprecation issue.

To my untrained eye, it looks like creating a new Notification will work on desktop (but may be deprecated at some point) but will fail on a mobile platform because notifications are implemented differently there.

So if I’m seeing this in the logs, it looks like some desktop code (new Notification) was executed on a device that does not support the creation of notifications in that way - i.e. mobile Chrome.

Indeed, the logs seem to show that the HTTP_USER_AGENT causing this failure are mobile browsers:

  • Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.105 Mobile Safari/537.36
  • Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG SM-A750F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/8.2 Chrome/63.0.3239.111 Mobile Safari/537.36

The only code that I can find in my installation using new Notification is in desktop-notifications.js.es6 in core - in the following sections:

and

Some specific questions

What is causing this warning to appear in the logs?

Can I ignore it?

Would it potentially cause the message bus to fail in the way I described above?