-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow 404s within a Subscription #110
Comments
This issue comes up in statebus here: |
Maybe something in the transport for the subscription can be used? In SSE, different event types could be used, one for creation event, one for deletion, and one for change. |
Yes, I believe that's what I was suggesting by (1) above. Let's make this more concrete with an example:
The question is how to express that a version doesn't exist. We could either make the response
Or perhaps by thinking of it as content that doesn't exist:
Or that's like, even more non-existent:
Or where there is no content-length in the first place, just the end of headers:
|
Hm, isn't deletion just a patch which removes everything? :-) So maybe just a patch-language should be rich enough to differentiate between change to "empty data" vs. "remove data itself". |
Yes, let's clarify the two types of "deletion":
This issue is about (1) deleting the entire resource. There's also an open question about whether any resource metadata is preserved after a |
There might be also another operation, i.e., |
I presented a new proposal for this on Monday at https://braid.org/meeting-71. The proposal is to add a status lines to each update, so that a sequence of updates will look like this:
We could then have one of those updates return a 404, or invent a new code like 114 for "delete update." |
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 theDELETE
method, and a non-existent resource can be created with aPUT
orPOST
.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 a404
within a subscription to reflect that the resource disappeared.I see two high-level options here:
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.The text was updated successfully, but these errors were encountered: