Push notifications cards buffered

41 views
Skip to first unread message

Keven Wang

unread,
May 10, 2015, 2:39:53 AM5/10/15
to gcm-for-chr...@googlegroups.com
In my Chrome extension, I've used Chrome GCM for push notification. In my extension's gcm listener, I create notification cards:

chrome.gcm.onMessage.addListener(function(message) {
    chrome.notifications.create(/* arguments */);
});

My users have reported numerous times that, they get a batch (more than 2 usually) of notification cards at once, in middle of a chrome browsing session. (not right after laptop wake up) I've tried to debug this by adding console.log() lines in gcm listener. What happens is that, the gcm listener does receive a batch of notifications at once. However, my server actually pushed them out a long time ago, at different times. (I added a "time-send" timestamp when my server calls GCM send.)

Is there any way that Chrome GCM is delaying delivery, or Chrome browser delaying gcm listener from firing?

Filip Gorski

unread,
May 11, 2015, 12:56:06 PM5/11/15
to gcm-for-chr...@googlegroups.com
Hi, Keven,

Thanks for another insightful question.

What you described could be due to limitations of GCM Client implementation. Sustaining a TCP connection relies on sending a periodic heartbeat message at a pre-negotiated resolution (15 minutes for WiFi and 28 for cellular). When a device running Chrome goes to sleep and then wakes up, sometimes OS does not report the time that have passed properly. This may lead to a situation where you have to wait for some extra time after a wake-up, for GCM to realize that connection is long gone. Establishing a new connection (which might also take a while, if unsuccessful, due to exponential backoff) will cause all of the pending messages to be delivered at once (and that will trigger multiple messages in a row).

I hope that makes sense. I know this may feel inconvenient, but good news this is likely not a problem in your code. We are working to make detection better.
Could you please share which platforms and Chrome versions behave that way?

Thanks.
Filip

Keven Wang

unread,
May 11, 2015, 1:54:57 PM5/11/15
to Filip Gorski, gcm-for-chr...@googlegroups.com
@Filip. That makes sense. GCM has already helped a ton by reducing our infra investment & allowing us to move quickly.

I believe for the last month, the latest versions of Chrome have this issue. So version 41 on Macbook Pro.

--
You received this message because you are subscribed to a topic in the Google Groups "GCM for Chrome feedback" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gcm-for-chrome-feedback/nMgV2vN7zic/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gcm-for-chrome-fe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Keven

Filip Gorski

unread,
May 13, 2015, 6:24:22 PM5/13/15
to gcm-for-chr...@googlegroups.com, fgo...@chromium.org
OK, Not sure if this is something we already looked at. Please send me details once you hit the problem again.

Thanks.
Filip


On Monday, May 11, 2015 at 10:54:57 AM UTC-7, Keven Wang wrote:
@Filip. That makes sense. GCM has already helped a ton by reducing our infra investment & allowing us to move quickly.

I believe for the last month, the latest versions of Chrome have this issue. So version 41 on Macbook Pro.

On Mon, May 11, 2015 at 9:56 AM, Filip Gorski <fgo...@chromium.org> wrote:
Hi, Keven,

Thanks for another insightful question.

What you described could be due to limitations of GCM Client implementation. Sustaining a TCP connection relies on sending a periodic heartbeat message at a pre-negotiated resolution (15 minutes for WiFi and 28 for cellular). When a device running Chrome goes to sleep and then wakes up, sometimes OS does not report the time that have passed properly. This may lead to a situation where you have to wait for some extra time after a wake-up, for GCM to realize that connection is long gone. Establishing a new connection (which might also take a while, if unsuccessful, due to exponential backoff) will cause all of the pending messages to be delivered at once (and that will trigger multiple messages in a row).

I hope that makes sense. I know this may feel inconvenient, but good news this is likely not a problem in your code. We are working to make detection better.
Could you please share which platforms and Chrome versions behave that way?

Thanks.
Filip

On Saturday, May 9, 2015 at 11:39:53 PM UTC-7, Keven Wang wrote:
In my Chrome extension, I've used Chrome GCM for push notification. In my extension's gcm listener, I create notification cards:

chrome.gcm.onMessage.addListener(function(message) {
    chrome.notifications.create(/* arguments */);
});

My users have reported numerous times that, they get a batch (more than 2 usually) of notification cards at once, in middle of a chrome browsing session. (not right after laptop wake up) I've tried to debug this by adding console.log() lines in gcm listener. What happens is that, the gcm listener does receive a batch of notifications at once. However, my server actually pushed them out a long time ago, at different times. (I added a "time-send" timestamp when my server calls GCM send.)

Is there any way that Chrome GCM is delaying delivery, or Chrome browser delaying gcm listener from firing




--

Keven

Keven Wang

unread,
Aug 28, 2015, 4:45:29 PM8/28/15
to Filip Gorski, gcm-for-chr...@googlegroups.com
Hi Filip,

I'm on Chrome 44.0.2403.157. I'm still experiencing this buffer issue. FYI.

--

Keven Wang

unread,
Aug 28, 2015, 4:46:14 PM8/28/15
to Filip Gorski, gcm-for-chr...@googlegroups.com
It happened this time after my laptop wakes up from sleep.

On Fri, Aug 28, 2015 at 1:45 PM, Keven Wang <ke...@relateiq.com> wrote:
Hi Filip,

I'm on Chrome 44.0.2403.157. I'm still experiencing this buffer issue. FYI.

Filip Gorski

unread,
Aug 28, 2015, 5:58:04 PM8/28/15
to Keven Wang, gcm-for-chr...@googlegroups.com
Keven,

Is this something that happens to you always when your laptop is waking up from sleep? Or is it the first time in 3 months? Can you reproduce it consistently?

Thanks.
Filip

Keven Wang

unread,
Aug 28, 2015, 6:58:23 PM8/28/15
to Filip Gorski, gcm-for-chr...@googlegroups.com
Yes, I can reproduce it consistently now. Here's what I did:

1. Put Macbook Pro to sleep.
2. Trigger 2 push notifications
3. Wake up laptop from sleep.
4. Push notifications arrives 4 minute after I woke up laptop (this time, right after when a 3rd push notification is triggered).

Let me know if more info is needed?


On Fri, Aug 28, 2015 at 2:57 PM, Filip Gorski <fgo...@chromium.org> wrote:
Keven,

Is this something that happens to you always when your laptop is waking up from sleep? Or is it the first time in 3 months? Can you reproduce it consistently?

Thanks.
Filip
On Fri, Aug 28, 2015 at 1:46 PM Keven Wang <ke...@relateiq.com> wrote:
It happened this time after my laptop wakes up from sleep.


Reply all
Reply to author
Forward
0 new messages