New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 760608 link

Starred by 8 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

chrome.notifications.onClosed callback "byUser" variable is always true

Reported by joaom...@gmail.com, Aug 30 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.59 Safari/537.36

Steps to reproduce the problem:
1. Create a notification
2. Let it be hidden automatically by Chrome with no user interaction
3. chrome.notifications.onClosed callback is called with the second parameter "byUser" set to true.

What is the expected behavior?
Since the user didn't close the notification, "byUser" should be set to false.

What went wrong?
"byUser" was set to true

Did this work before? Yes I think version 60 but not completely sure

Does this work in other browsers? Yes

Chrome version: 61.0.3163.59  Channel: beta
OS Version: 10.0
Flash Version:
 
Cc: pbomm...@chromium.org
Components: UI>Notifications
Labels: Needs-Triage-M61 Needs-Feedback
 joaomgcd@ if possible can you please provide a testurl.

Comment 2 by joaom...@gmail.com, Aug 31 2017

It happens in Chrome extensions.

Attached is a very simple extension where this happens.

Hope this helps.
TestExtension.zip
15.5 KB Download
Project Member

Comment 3 by sheriffbot@chromium.org, Aug 31 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "pbommana@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: rbasuvula@chromium.org
Labels: Needs-Feedback
Tested in chrome #61.0.3163.59 & Beta #61.0.3163.71 on win 10.0 & 7 and Please find the screen cast for your reference.
Observations: If user didn't close the notification, After few seconds notification disappeared as intended.

@ joaomgcd: Could you please let me know if i have missed anything and if possible,Please create new profile without extensions and apps.Re-check once and let us know the observations and provide more inputs on expected behaviour of the issue which would help us to triage the issue further.

Thanks in Advance.
760608.mp4
1.3 MB View Download

Comment 5 by joaom...@gmail.com, Sep 4 2017

I think the problem is that you're looking at the log for the extensions page.
You need to open the background page link to see the log for the extension script.

Right?

Let me know what you think.
Project Member

Comment 6 by sheriffbot@chromium.org, Sep 4 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "rbasuvula@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by peter@chromium.org, Sep 7 2017

Cc: peter@chromium.org
Labels: OS-Linux
Status: Available (was: Unconfirmed)
Looks like NotificationDisplayService::ProcessNotificationOperation() assumes that something happened because of user interaction. The caller, WebNotificationDelegate::OnClose(), knows the real value of |by_user|, but has no way to pass this through.

Let's fix this when removing the WebNotificationDelegate.

Comment 8 by joaom...@gmail.com, Sep 7 2017

Thanks for the feedback.

Just to let you know, this has a serious impact on my chrome extension.
My extension allows you to sync notifications from your Android device to Chrome, so because the extension now always gets the information that the notification was removed by the user, users are getting their notifications removed from their Android devices as well.

Thanks again.

Comment 9 by peter@chromium.org, Sep 7 2017

Owner: peter@chromium.org
Status: Started (was: Available)
Muh, that's an important use-case indeed. Sorry for the breakage!

I've uploaded a CL that addresses this:
https://chromium-review.googlesource.com/655717
Labels: -Needs-Triage-M61
Actually, the following is the fix:
  https://chromium-review.googlesource.com/c/chromium/src/+/655720

I've kept it self-contained in case we want to merge it.

The following two CLs are associated clean-ups:
  https://chromium-review.googlesource.com/c/chromium/src/+/655717
  https://chromium-review.googlesource.com/c/chromium/src/+/655307
  
Thank you very much for the fix! 

Do you have a general idea how much time it usually takes for fixes like these to reach the stable Chrome releases?
Assuming this lands and gets merged, earliest would be Chrome 62, which reaches stable around the week of October 24. We missed the boat for Chrome 61 I'm afraid.
And what about the Beta and Dev channels?
No way to say until this lands. Will update you when we know!
Project Member

Comment 15 by bugdroid1@chromium.org, Sep 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/961c74da485f407caf877fe2eadc84e767af3ebc

commit 961c74da485f407caf877fe2eadc84e767af3ebc
Author: Peter Beverloo <peter@chromium.org>
Date: Fri Sep 08 13:10:22 2017

Propagate the by_user flag to Notification Handlers

Whether a notification close was initiated by the user is known to the
WebNotificationDelegate, but the dispatching code towards the
notification handlers is unaware and assumes it was. This difference can
be significant, so propagate it when it's known.

BUG= 760608 

Change-Id: I23d1be533d62efae6e623758e9f2b0e6f3557e71
Reviewed-on: https://chromium-review.googlesource.com/655720
Reviewed-by: Anita Woodruff <awdf@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500577}
[modify] https://crrev.com/961c74da485f407caf877fe2eadc84e767af3ebc/chrome/browser/notifications/notification_display_service.cc
[modify] https://crrev.com/961c74da485f407caf877fe2eadc84e767af3ebc/chrome/browser/notifications/notification_display_service.h
[modify] https://crrev.com/961c74da485f407caf877fe2eadc84e767af3ebc/chrome/browser/notifications/web_notification_delegate.cc

Comment 16 by peter@chromium.org, Sep 11 2017

Labels: Merge-Request-62
I've verified that the fix in #c15 works. Requesting merge to M62, given that this breaks the use case mentioned in #c8.
Labels: -Merge-Request-62 Merge-Approved-62
Thanks for the fix. Approving this merge to M62, branch: 3202. 
Project Member

Comment 18 by bugdroid1@chromium.org, Sep 12 2017

Labels: -merge-approved-62 merge-merged-3202
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cbb38c15dffe9b3e36fb22e9691e857d7beefaa8

commit cbb38c15dffe9b3e36fb22e9691e857d7beefaa8
Author: Peter Beverloo <peter@chromium.org>
Date: Tue Sep 12 14:22:22 2017

Propagate the by_user flag to Notification Handlers

Whether a notification close was initiated by the user is known to the
WebNotificationDelegate, but the dispatching code towards the
notification handlers is unaware and assumes it was. This difference can
be significant, so propagate it when it's known.

BUG= 760608 
TBR=peter@chromium.org

(cherry picked from commit 961c74da485f407caf877fe2eadc84e767af3ebc)

Change-Id: I23d1be533d62efae6e623758e9f2b0e6f3557e71
Reviewed-on: https://chromium-review.googlesource.com/655720
Reviewed-by: Anita Woodruff <awdf@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#500577}
Reviewed-on: https://chromium-review.googlesource.com/663263
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/branch-heads/3202@{#164}
Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}
[modify] https://crrev.com/cbb38c15dffe9b3e36fb22e9691e857d7beefaa8/chrome/browser/notifications/notification_display_service.cc
[modify] https://crrev.com/cbb38c15dffe9b3e36fb22e9691e857d7beefaa8/chrome/browser/notifications/notification_display_service.h
[modify] https://crrev.com/cbb38c15dffe9b3e36fb22e9691e857d7beefaa8/chrome/browser/notifications/web_notification_delegate.cc

Comment 19 by peter@chromium.org, Sep 12 2017

Status: Fixed (was: Started)
The fix will ship as part of Chrome 62. It's available in Canary today, Dev tomorrow, as well as the upcoming Beta (~this week) and Stable (~late October) releases.

Comment 20 by joaom...@gmail.com, Sep 12 2017

Thanks again for your help on this!

Comment 21 by joaom...@gmail.com, Sep 18 2017

Hello again.
I've now updated my beta version of Chrome to

Version 62.0.3202.18 (Official Build) beta (64-bit)

It still has the same issue. 

I can confirm that on Chrome Canary with version:

Version 63.0.3218.0 (Official Build) canary (64-bit)

it is working correctly.

Does this mean that version 62 won't have this fix after all?
Thanks in advance.
Labels: TE-Verified-62.0.3202.29 TE-Verified-M62
Tested the issue using #62.0.3202.29 on linux Ubuntu 14.04, Win7 as per the steps mentioned in comment #0. Observed "byUser" is to false now.

Please find the screencast for the same, hence adding Verified labels.

Thanks!!
760608.webm
4.2 MB View Download

Comment 23 by joaom...@gmail.com, Sep 21 2017

Ok, today I got the update for Version 62.0.3202.29 (Official Build) beta (64-bit) and it now works too :) Thanks! Must've been this last jump from .18 to .29 that did it!

Thanks again!
Labels: M-62 ReleaseBlock-Stable
Cc: nyerramilli@chromium.org susanjuniab@chromium.org
 Issue 771056  has been merged into this issue.

Sign in to add a comment