Rejecting a subscription

11 views
Skip to first unread message

Elias Mårtenson

unread,
Aug 28, 2010, 12:54:54 PM8/28/10
to Pubsubhubbub
In my application I subscribe and unsubscribe to many feeds. I keep
track of this in a database on the app server side. Unfortunately (due
to some bugs of mine) some subscription details were dropped which
caused my database to be out of sync with the actual subscriptions
from the hub. The net effect of this is that I get a lot of pushed
notifications for feeds that I am actually not interested in.

Is there a "proper" response code I should return to the hub when it
contacts me with data for a subscription that I don't want?
Essentially, something that should cause the hub to drop the
subscription.

I can't unsubscribe in the "proper" manner, because there is no
information as to exactly which hub is sending the data. This is
something that seems like an omission in the spec as far as I can
tell. There is not enough information in a hub push message to
actually unsubscribe from the feed.

Brett Slatkin

unread,
Aug 28, 2010, 8:46:52 PM8/28/10
to pubsub...@googlegroups.com
Check out:

http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html#rfc.section.6.2.1

"The subscriber MUST confirm that the hub.topic and hub.verify_token
correspond to a pending subscription or unsubscription that it wishes
to carry out. If so, the subscriber MUST respond with an HTTP success
(2xx) code with a response body equal to the hub.challenge parameter.
If the subscriber does not agree with the action, the subscriber MUST
respond with a 404 "Not Found" response."


So just wait around for auto-refreshing and return a 404 for
subscriptions you don't have and you're golden. Just be sure to return
200s for event deliveries on these same subscriptions. The 404 only
applies to subscription requests. If you reply with 404 to an event
delivery, the hub will just try again.

-Brett

Elias Mårtenson

unread,
Aug 29, 2010, 10:45:27 PM8/29/10
to Pubsubhubbub
On Aug 29, 8:46 am, Brett Slatkin <bslat...@gmail.com> wrote:

> So just wait around for auto-refreshing and return a 404 for
> subscriptions you don't have and you're golden. Just be sure to return
> 200s for event deliveries on these same subscriptions. The 404 only
> applies to subscription requests. If you reply with 404 to an event
> delivery, the hub will just try again.

Thank you. I will make sure this is what I do.

Regards,
Elias
Reply all
Reply to author
Forward
0 new messages