- From: Marco Colli <notifications@github.com>
- Date: Thu, 30 Apr 2020 09:43:59 -0700
- To: w3c/push-api <push-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 30 April 2020 16:44:12 UTC
@novaknole 1. Yes, right. However you need to handle each status code: check the push service docs for the meaning of each status code they can return and handle appropriately. For Pushpad for example we handle temporary errors and permanent errors differently. Also we use a trash (and not delete directly) to prevent temporary errors from deleting all the data. 2. Yes, exactly: you can just replace the subscription and keep the old data, since you know the old endpoint. 3. You need to check frequently with your server if the subscription is actually present in your server, otherwise you are right: you can lose the subscription (since `pushsubscriptionchange` and `fetch` are not 100% safe). You need to use some sort of caching mechanism (e.g. localStorage or sessionStorage) in the browser to avoid too many requests to the server (e.g. on each page is too much), but you also need to send checks to the server sometimes(to make sure that the subscription is actually in your database). -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/push-api/issues/302#issuecomment-621969576
Received on Thursday, 30 April 2020 16:44:12 UTC