Closed Bug 1308664 Opened 8 years ago Closed 4 years ago

Popup window not recorded as visited origin causes push notifications to not be shown

Categories

(Firefox for Android Graveyard :: General, defect)

49 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: jasonpang2011, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

Steps to reproduce:

--------------------------------------------------------------------------
Reproducing Bug on Firefox for Android 49
------------------------------------------------------------------------------

1. On Firefox for Android, visit about:config and set dom.push.debug to true according to https://goo.gl/CzCPRA.

2. On Firefox for Android, close all open tabs, and clear all private data (http://i.imgur.com/ZWRqJuh.png).

3. Connect your Android phone to your computer to allow Logcat debugging, using adb logcat, or by downloading Android Studio on to your computer (Android Studio has a built-in logcat). Enable logcat logging.

4. On Firefox for Android, after clearing all private data, open a new tab to http://notify.tech.

5. You should see a prompt at the bottom asking you to subscribe. Click Allow. If you do not see any such prompt, click the three-lined menu button at the top right of the page (in mobile view), and click "Subscribe to notifications".

6. A popup window should open up, with the popup window asking you to subscribe to notification on its domain (wordpressdemo.onesignal.com). Please click Allow to receive notifications. 

    ^ This is the popup that doesn't seem to count towards the user's history.

7. A notification will be automatically sent by the site after subscribing. You should see the logcat says "console.error: PushService", "receivedPushMessage: Error notifying app", "Message: Error: Ignoring message sent to unvisited origin".



--------------------------------------------------------------------------
Similar Procedure on Firefox for Desktop 49.0.1 (Showing No Bug)
--------------------------------------------------------------------------

1. On Firefox for Desktop, visit about:config and set dom.push.loglevel to "debug" according to https://goo.gl/CzCPRA.

2. On Firefox for Desktop, close all open tabs, and clear all browsing data.

3. On Firefox for Desktop, open Tools > Web Developer > Browser Console.

4. On Firefox for Desktop, after clearing all browsing data, open a new tab to http://notify.tech.

5. You should see a prompt sliding down at the top asking you to subscribe. Click Allow. If you do not see any such prompt, click "Subscribe to notifications".

6. A popup window should open up, with the popup window asking you to subscribe to notification on its domain (wordpressdemo.onesignal.com). Please click Allow to receive notifications. 

    ^ This popup does seem to count towards the user's history, and a push notification is shown.

7. A notification will be automatically sent by the site after subscribing. You should see the notification, and logcat shows successful delivery of the message "PushService:notificationForOriginShown() "https://wordpressdemo.onesignal.com"PushService.jsm:939".



-------------------------------
Attachments
-------------------------------
Attached as one file:

Attachment #1 [details] [diff]: Firefox for Android 49, Subscription Log
Attachment #2 [details] [diff]: Firefox for Android 49, Message Receipt Log (bug shown here)
Attachment #3 [details] [diff]: Firefox for Desktop 49, Subscription Log
Attachment #4 [details] [diff]: Firefox for Desktop 49, Message Receipt Log


Actual results:

On Firefox for Android 49, a push notification was not shown. This appears to be due to the popup (on which the user grants notification permissions and subscribes) not counting toward the user's history, and this is used as part of the push service's notification quota to determine whether to show a notification or not (?)

On Firefox for Desktop 49, a push notification is shown successfully.


Expected results:

On Firefox for Android 49, a push notification should have been shown.
I was able to reproduce this issue on Samsung Galaxy Note 5 (Android 6.0), however I wasn't able to see the error on logcat.I will investigate further.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: android-push
See Also: → 1329493
Hi there,

Is there any update or progress on this issue? 

I believe this is breaking Firefox Android web push whenever a popup is opened to an HTTPS site to subscribe. Some push providers provide web push for HTTP sites by opening a popup to another HTTPS site to subscribe users, since some HTTP sites aren't able to transition to HTTPS just yet.

Testing Update:

On step #4 of the original bug thread, please visit https://onesignal.github.io/HttpWebPushDemo instead of http://notify.tech. The notify.tech site changes occasionally, so we made another demo site for this bug.
Ioana, can you confirm this?
Flags: needinfo?(ioana.chiorean)
Attached file errorsPush.txt
Pixel XL - Android 7.1.2 , Nightly 56.0a1  2017-07-30

I am not seeing step 7
> 7. A notification will be automatically sent by the site after subscribing. You should see the logcat says "console.error: 
> PushService", "receivedPushMessage: Error notifying app", "Message: Error: Ignoring message sent to unvisited origin".

No notification is triggered. So I am able to reproduce it. 
For the errors I get this: 

07-31 11:24:52.868: E/GeckoConsole(5668): [JavaScript Error: "receivedPushMessage: Error notifying app Error: Ignoring message sent to unvisited origin"]

See attached file with all errors.
Flags: needinfo?(ioana.chiorean)
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: