Comments (9)
User agent may note that it has missed a push message, e.g. if messages are numbered in the protocol between push server and user agent and it receives message number 54 after number 52. An error message indicates to the webapp that something went wrong. pushregistrationlost is maybe not the best wording. If I recall correctly it used to be pusherror and was changed into pushregistrationlost at some point
from push-api.
The numbering thing is not something that I'd rely on.
There are two reasons this might occur: either the push server can't be contacted because it is broken; or the registration might become invalid (either because the server decides it needs to, or it might just have a time limit).
Clients learn of this by either being unable to talk to the push server, or by receiving signals from the push server.
from push-api.
You can lose registrations (pushregistrationlost event
) or messages (messagelost event
), these are separate use cases and we should have separate events for them. I think that was the conclusion of issue #18.
Currently I'm not sure Chrome will ever fire pushregistrationlost
because it does not poll GCM to verify validity of its registrations. Polling seems wasteful of battery. The webapp will never be notified by the push system because it does not know who to notify. When the application server attempts to push new messages to the push server, the push server will reject for unknown registrations. So the application server will eventually know, and it can tell the webapp through another mechanism e.g. at webapp startup.
Using a GCM based implementation we might be able to fire messagelost
. There is a limit of 100 pending messages on the GCM server and when it is exceeded all are dropped. The client will be informed of this: https://developer.android.com/google/gcm/adv.html
from push-api.
I wasn't suggesting that you do poll. I'm asking whether you care about reporting the fact that GCM itself might be unreachable. I assume that you have the ability to learn about that.
This might only be a transient problem, but I've used other systems where a registration is homed on a particular instance, and while it can be recovered in some circumstances if that instance goes down, not all errors can be recovered immediately. That requires recreation of registrations.
That might not be a problem with GCM short of a complete catastrophe, but I wouldn't say that this is a guarantee.
from push-api.
Registration 'lost' and GCM reachability are different issues. For 'lost' registration - it affects a very small percentage of devices, and the 'support' solution is to ask for a factory reset to recover, in part because we lack the notification (and many apps didn't implement it properly in C2DM ).
An even smaller number of devices have a 'cloning' problem - where backup/reset was used. I don't know if browsers profile dir is based on hardware id, but on android a rooted device can be cloned - and the clone will have same registration IDs, so messages go randomly to one of the clones.
Reachability of the push server should be a separate issue - seems very useful to provide, but some care is needed - the connection status events can't be broadcast to all apps ( too frequent, memory/load issues when you have lots of apps ), apps need to query and register a listener for connection events.
from push-api.
Out of interest, assuming that pushsubscriptionlost event is used by a push service, what is the process to re-register?
I'm assuming the expiration of a push subscription does not remove the permission to re-request a new push subscription ID, however, I can't see any mention of making the PushManager accessible to the ServiceWorkerGlobalScope (although I may be thinking the wrong way), is this intentional?
from push-api.
The ServiceWorkerGlobalScope
has readonly attribute ServiceWorkerRegistration registration
.
from push-api.
The Chrome implementation bug is here: https://crbug.com/437677
from push-api.
Thanks @mvano was looking at w3 spec and then obviously missing that bug. Tracking that.
from push-api.
Related Issues (20)
- PushPermissionState and PermissionState are the same
- Progressing spec to CR HOT 4
- Should there be a UTF-8 health warning? HOT 2
- Status report and planning for TPAC 2021 HOT 1
- Consider using DOMHighResTimestamp instead of DOMTimeStamp HOT 1
- Mention or enforce userVisibleOnly check in PushManager.subscribe? HOT 2
- Clarify purpose expirationTime HOT 1
- Duplicate definition of PushPermissionDescriptor HOT 1
- Should push be a policy-controlled feature? HOT 1
- Does PushManager subscribe() need transient activation check? HOT 2
- Question: what about shared device
- TPAC 2022 status report
- Documentation: It's not clear how to specify the push service HOT 2
- Browser MUST always display a permission prompt after a user interaction HOT 2
- New push subscription MUST have an endpoint that's different from the original HOT 1
- Best practices to dismiss web push notifications cross devices HOT 1
- Declarative Web Push HOT 14
- Permission Revocation - English language clarification
- Mention Safari Implementation HOT 1
- WPT testability HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from push-api.