New issue
Advanced search Search tips

Issue 681825 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

WaPo push notification does not open Chrome/Page

Project Member Reported by cbentzel@chromium.org, Jan 17 2017

Issue description

Chrome Version: 57.0.2983.0
OS: Android 7.1.1

[It's possible this is an external issue]

I received a push notification from washingtonpost.com inside of Chrome Canary. Clicking on it did not bring up Chrome Canary, nor navigated to the page that it was talking about. I have not dug in to see if this is a regression in Chrome, an issue with how Washington Post is using notifications, or something else.
 

Comment 1 by peter@chromium.org, Jan 24 2017

Cc: -peter@chromium.org
Components: UI>Notifications Blink>PushAPI
Owner: peter@chromium.org
Status: ExternalDependency (was: Untriaged)
Their Service Worker code is here:
    https://www.washingtonpost.com/sw.js

I notice the issue that's definitely causing this bug, as well as one peculiarity.

The issue is that they assume the Service Worker will remain alive between the `push` and the `notificationclick` events. The |notification_data| global is populated in the `push` event after receiving a message, and is read in the `notificationclick` event.

In reality, you can never rely on the lifetime of a Service Worker and it's global scope. We'll forcefully shut it down after a few minutes at most, so if the user sees the notification after that (which is very likely on Android) it'll have a clean global state. This causes a JavaScript error in the following assignment in the `notificationclick` event:

  > var contentURL = notification_data[0].contentURL

Which, in turn, neither closes the notification (which is done after), nor focuses or opens a new window.

The peculiarity I notice is that they delay the `notificationclick` event by 500ms through a setTimeout(). Why? That just degrades the user experience. Maybe they ran into a race condition that we're not aware of?

Comment 2 by peter@chromium.org, Jan 27 2017

Status: Fixed (was: ExternalDependency)
The issue has been fixed.

Sign in to add a comment