-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Right now there are a number of gaps in WebSub that make it possible to miss updates without hacky workarounds. It would be nice if reliable subscriptions could be provided without extra feed fetches.
Consider the following scenarios:
Fetch - Subscribe Race
- Subscriber fetches document.
- Document Updates
- Subscriber subscribes to hub.
In this case the subscriber would never notice that an item was posted.
Workaround - Refetch
One workaround is to simply refetch the feed a short while after the subscription is confirmed. This still relies on some consistency between HTTP caches and the hub but with a sufficent delay should be sufficient.
Solution - If-Match
If the subscriber could include an ETag or Last-Modified header from when they fetched the document the hub could notify the subscriber if there are missed entires.
Solution - Proactive Push
Another option is that once a subscription is confirmed the hub could push the full "current" state of the document form its point of view. Future delta updates are sent relative to the initial full push.
Resubscribe Race
- Subscription expires.
- Document updates.
- Subscriber "re-subscribes"
IIUC there is currently no indication if a subscription request updated an existing subscription or created a new subscription.
Workaround - Resubscribe Early
If resubscribing sufficiently early it is probably safe to assume that clocks are vaguely in sync.
Workaround - Refetch
Much like the initial subscription race you can simply refetch the feed a short while after the subscription is confirmed.
Solution - Proactive Push
If using proactive push above this could be done for new subscriptions, for extended subscriptions the push would not reoccur.
Solution - Resubscription Confirmation
The hub can respond to the subscription request with some sort of indicator confirming that the subscription has been uninterrupted.