Allow event batching

オープン
#403 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
api

調査の方向性

Start by reading the Push API specification around PushManager.subscribe and push event delivery; the issue does not name a file or test. Define how opt-in coalescing affects queued messages and event handling, then add specification text and tests that show a subscription with coalesce: true delivers a batch that developers can use to make one request and choose a notification.

索引モデルが issue の本文から書いたものです。

説明

Right now, Safari fires push events sequentially, as in it fires the event, then waits for all the event.waitUntil calls to settle, before it fires the next one.

Assuming that events are generally processed like this:

  1. Look at push payload
  2. Show notification based on that payload

Or:

  1. Look at push payload
  2. Make network request for data
  3. Show notification based on payload + response

In cases where the device has a queue of push messages, it seems advantageous to batch these into a single event. This would allow developers to make a single network request, rather than a series of network requests, and be smart about the notification displayed, e.g. "You have 7 new messages".

There's prior art here with getCoalescedEvents.

This would need to be opt-in as part of pushManager.subscribe, eg:

await serviceWorkerRegistration.pushManager.subscribe({
  coalesce: true,
});
主要言語
HTML
スター
158
フォーク
43
平均マージ
2日 6時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

w3c/push-api のほかの issue

w3c/push-api の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。