-
Notifications
You must be signed in to change notification settings - Fork 16
Description
In existing HTTP, if a resource doesn't exist, the server responds with a 404 not found and ends the connection. A resource that exists can be deleted with the DELETE method, and a non-existent resource can be created with a PUT or POST.
Braid adds subscription to HTTP, and it'd be nice to subscribe to a resource and be notified when it comes into existence, and when it's deleted, in addition to when it changes. However, subscriptions return a 209 status code, and we have no way to send a 404 within a subscription to reflect that the resource disappeared.
I see two high-level options here:
- We find a way to express a "this resource does not exist" update over a subscription
- We require that subscriptions only work on resources that exist, and end as soon as a resource is deleted
I'm in favor of (1), but it does require us to invent a new syntax for embedding "resource has been deleted" within a subscription response. Perhaps we can send a header like :status: 404, similar to how HTTP2 represents a status code as a pseudo-header.