Skip to content

Add a way to cancel previous push notification #399

Open

Description

@saschanaz

We got a feature request in https://bugzilla.mozilla.org/show_bug.cgi?id=1957195, which I think is a valid one:

Chess.com is a the primary source for this issue, trigger many notifications by using the website on a secondary device (this can be as simple as playing a daily game) then launch firefox, the queued notifications will start one after the other with no way to dismiss all sometimes taking several minutes to finish.

Here, there are two independent push subscriptions managed by one app server, tied to one user account. The app server triggers two push messages for an event, but even if the user got one from either of the subscriptions, there's no way for the app server to cancel another push message for another subscription.

Canceling already delivered push notification may be more tricky (would it allow abusing e.g. for effectively no-notification push?) but it still sounds reasonable to cancel a push message that hasn't delivered yet.

Activity

  1. saschanaz commented on Mar 30, 2025

    @saschanaz
    MemberAuthor

    The problem is that there's no unencrypted metadata field for push messages that push servers can read. 🤔 Add an HTTP header field instead?

  2. martinthomson commented on Mar 31, 2025

    @martinthomson
    Member

    The original idea for this was to allow a DELETE on the resource that was created by the push service when a message is posted.

    See https://datatracker.ietf.org/doc/html/rfc8030#section-5.4 for an example of replacement. In addition to that, you might imagine that a push service could support deletion.

    From a request:

    POST /push/JzLQ3raZJfFBR0aqvOMsLrt54w4rJUsV HTTP/1.1
    Host: push.example.net
    TTL: 600
    Topic: upd
    
    ... message contents ...

    To which the server responds:

    HTTP/1.1 201 Created
    Date: Thu, 11 Dec 2014 23:57:02 GMT
    Location: https://push.example.net/message/qDIYHNcfAIPP_5ITvURr-d6BGt

    That example shows the message contents being replaced, but they could also be replaced with nothing (i.e., removed) as follows:

    DELETE /message/qDIYHNcfAIPP_5ITvURr-d6BGt
    Host: push.example.net

    Using the "Topic" field to enable this ensures that the push service is able to know which messages to enable this treatment for, but it's equally possible that this could be done for all messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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