Skip to content

Consistency Issues with WebSub #174

@kevincox

Description

@kevincox

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

  1. Subscriber fetches document.
  2. Document Updates
  3. 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

  1. Subscription expires.
  2. Document updates.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions