New issue
Advanced search Search tips

Issue 647943 link

Starred by 4 users

Issue metadata

Status: Fixed
Closed: Dec 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Sign in to add a comment

Service worker can keep itself alive by self postMessage

Project Member Reported by, Sep 17 2016

Issue description

Reported here by Hari krishna:
We have been playing around serviceWorker functionalities. What we did is, we created a message event handler, that spawns another message event for every minute.

Example code shown below.
self.addEventListener('message', function (event) {
    var spawnNewMessageEvent = function (data) {
        return new Promise(function (success) {
            setTimeout(function () {
                var sw =;
            }, 30000)


Comment 2 by, Nov 17 2016

Status: Started (was: Available)
Project Member

Comment 3 by, Dec 5 2016

The following revision refers to this bug:

commit f88b52ec1e4aebd7c1f28b13a58bfad92d04ba94
Author: mek <>
Date: Mon Dec 05 20:42:16 2016

Prevent a service worker from keeping itself alive by self postMessage.

This changes the timeout for message events when the message was sent from
a service worker to be the curent timeout of that service worker. So while
a service worker can still post message to itself, this won't allow it to
stay alive any longer than a single event would.

BUG= 647943 , 648836 

Cr-Commit-Position: refs/heads/master@{#436393}


Comment 4 by, Dec 13 2016

Labels: M-57
Status: Fixed (was: Started)

Sign in to add a comment