Skip to content

postMessage keeps service workers alive indefinitely #980

Closed
@mfalken

Description

@mfalken

Chrome has a bug where a service worker can postMessage to itself to stay alive indefinitely: https://bugs.chromium.org/p/chromium/issues/detail?id=647943

You can also register at two scopes and have those workers ping-pong messages.

I'm wondering if this should be prevented at the spec level, for example:

  • postMessage to a service worker that has no in-scope (or same-origin) client won't wake it up, or
  • postMessage from a service worker doesn't wake up the destination service worker

If this is an implementation detail, would something heuristic like a SW can be kept alive by at most 5 messages events be reasonable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions