summaryrefslogtreecommitdiffstats
path: root/dom/interfaces/push/nsIPushErrorReporter.idl
blob: da190794a2e1d6661d81b02c948261f716402da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

[scriptable, uuid(b58249f9-1a04-48cc-bc20-2c992d64c73e)]
interface nsIPushErrorReporter : nsISupports
{
  /**
   * Ack types, reported when the Push service acknowledges an incoming message.
   *
   * Acks are sent before the message is dispatched to the service worker,
   * since the server delays new messages until all outstanding ones have been
   * acked. |reportDeliveryError| will be called if an error occurs in the
   * worker's `push` event handler after acking the message.
  */
  const uint16_t ACK_DELIVERED = 0;
  const uint16_t ACK_DECRYPTION_ERROR = 1;
  const uint16_t ACK_NOT_DELIVERED = 2;

  /**
   * Unsubscribe reasons, reported when the service drops a subscription.
   */
  const uint16_t UNSUBSCRIBE_MANUAL = 3;
  const uint16_t UNSUBSCRIBE_QUOTA_EXCEEDED = 4;
  const uint16_t UNSUBSCRIBE_PERMISSION_REVOKED = 5;

  /**
   * Delivery error reasons, reported when a service worker fails to handle
   * an incoming push message in its `push` event handler.
   */
  const uint16_t DELIVERY_UNCAUGHT_EXCEPTION = 6;
  const uint16_t DELIVERY_UNHANDLED_REJECTION = 7;
  const uint16_t DELIVERY_INTERNAL_ERROR = 8;

  /**
   * Reports a `push` event handler error to the Push service. |messageId| is
   * an opaque string passed to `nsIPushNotifier.notifyPush{WithData}`.
   * |reason| is a delivery error reason.
   */
  void reportDeliveryError(in AString messageId,
                           [optional] in uint16_t reason);
};