marten-de-vries / Flask-WebSub

A Flask extension implementation of the WebSub specification
ISC License
21 stars 4 forks source link

Subscriber doesn't accept "denied" for a previously accepted subscription. #2

Closed chrahunt closed 5 years ago

chrahunt commented 5 years ago

Per here:

The subscription MAY be denied by the hub at any point (even if it was previously accepted). The Subscriber SHOULD then consider that the subscription is not possible anymore.

However we're returning with 404 here if a denial comes in that is not associated with a pending subscription request.

marten-de-vries commented 5 years ago

Thanks for the report. Looks like you're right: as I understand it, a hub can accept a subscription for a while, then drop it with the mode 'denied' at any time while it's not expired. (If it is expired, I'd say returning 404 makes sense.) I'm not sure why a hub would ever do such a thing, but it's allowed.

If a subscriber gets into that situation, it should probably:

marten-de-vries commented 5 years ago

@chrahunt Did you encounter this in practise, or is it a purely theoretical concern? If the former, I would appreciate it if you could check if #3 solves the issue.

marten-de-vries commented 5 years ago

Ok, I think the current master branch should be able to handle this edge case. If not, feel free to re-open.