Allow event batching

Aperta
#403 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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,
});
Lingua principale
HTML
Stelle
158
Fork
43
Merge medio
2g 6h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di w3c/push-api

Tutte le issue di w3c/push-api

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.