Skip to content

Define behaviour of pushsubscriptionchange in the event of an error #205

Closed
@benlast

Description

@benlast

When I say "the spec", I'm referring to https://w3c.github.io/push-api/#the-pushsubscriptionchange-event.

It's not defined that a pushsubscriptionchange event will be fired when the browser has network connectivity, and of course it's also possible that any given network request may fail for a variety of reasons.

In a pushsubscriptionchange event handler, it may be a common requirement for the service worker to update new subscription details to some application server. It's not clear how to handle the case of a failure in the network upload.

As a suggestion; If the network Promise is included in event.waitUntil, and the Promise rejects, the event may be re-sent to allow the service worker code to retry.

Otherwise, the event handler code must flag that a retry is required, and wait for some opportunity to retry the upload. However, it's not clear what opportunity it will get. Since the spec says that any old subscription is unsubscribed on completion of the pushsubscriptionchange event, no further push events may be expected, and there is no guarantee that there will be any other event (such as install or activate) fired.

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