-
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
Remove blank line after subscription headers #85
Comments
I think this is a very interesting proposal! Good idea, Duane. I especially appreciate point (2). I am not yet sure that point (1) will work, because we are returning a different status code and aren't closing the connection after sending the body, but that's an empirical question that I'd love to learn the answer to. I want to think on this for a while and then give my thoughts, but I'm quite intrigued. |
I just realized that this conflicts with the specification for the "all-caught-up" version: https://github.com/braid-work/braid-spec/pull/79/files
That first This also brings up another issue to consider— it's common for a server to send not the current version to a new connecting client, but rather a whole set of versions. This is important, for instance, when other clients might be actively editing the resource, and might create a patch based on an old version that the new connecting client needs to know about. The unfortunate consequence of this is that it becomes less conceptually elegant to group the "first version" in with the initial response. If a client that doesn't know about Braid Subscriptions connects, and just looks at the initial version that comes across the wire, it'll actually be looking at an old out-of-date version. The current version will often come later in the stream. |
Does the addition of the |
Yes, it does resolve it for me! Although I do wonder if |
I like |
Notes from https://braid.org/meeting-3: Cases that interact with this proposal:
Question:
Use-case:
|
Punt to 04 |
(Removing Chair hat:) After some thought, I think this is a very good improvement. I'm on board! This proposal will clarify that there are only TWO levels of data in Braid-HTTP subscriptions:
This will make things much more elegant. Notice that this will make Normal GET:
GET + Subscribe:
I think the symmetry we're creating there is a very good thing. The blank line in Subscriptions has been giving the impression that there are three levels of headers (e.g. see #96 (comment)):
However, I claim that there's no need for a distinction between 2 and 3. This false distinction has been confusing people. I think we should remove it. Where this blank line came fromI think the blank line was probably introduced into our code accidentally while implementing, because when we use existing HTTP libraries, we have to generate and parse headers within the "body" of a message from the library's perspective, and the library automatically inserts a blank line between its headers and body. When we generated We'll need to modify our implementations so that they generate the headers for the first update into the existing HTTP header libraries, and then generate subsequent headers into the body of the message. And when reading messages, our parsers will need to copy the initial update's headers from the library's headers list, and then parse the headers for subsequent updates itself. |
Concluding the other issues brought up in Meeting-3These issues are orthogonal:
^ This is already an allowed server behavior, but we'll want a way for clients to request it when initiating a Subscription.
^ Denoting the initial set of operations is addressed by the "all-caught-up"
^ This is handled with the The following are suggestions for parameters that we'll want to add to the Subscribe header.
We have had a number of ideas for parameters to the Subscribe header bubble up, such as: #101, #89, #92, #80, #62, #54, #105, #115. We should probably consolidate these into a single issue, and write up a PR. Also, we should look at @brynbellomy's Redwood here, because he implemented such a set of parameters in |
I'm re-nominating this for consideration in draft 03, because:
|
Notes from Meeting-67:
|
I've drafted this up in PR #121 |
To expand on my suggestion:
|
@CxRes are you describing the situation described in #105? What is a scenario in which there would be no initial representation? The one that comes to mind for me is that you subscribe to a resource with a |
Something like that. Suppose a client has already obtained a cached copy. They could subscribe with a request where they explicitly ask for a representation to be sent only if the event-id/version has changed, otherwise only updates be sent. I have explicitly covered this in PREP. See implementation guidance under section 7 for such a Request and section 9.2 for a corresponding response. |
I implemented this, and found it breaks with chrome's |
When a client makes a GET request with
Subscribe:
header set, the server responds without version, parents, and merge-type headers in the canonical response headers. Instead, they are sent in a subsequent block that is only accessible with special braid-header ("virtual header") parsing.https://github.com/braid-work/braid-spec/blob/bf179d8c84ea48b5cb1ea4faf23c6ea9bfc28416/draft-toomim-httpbis-braid-http-03.txt#L406-L472
What if we combine the first version's headers with the canonical HTTP response headers? See PR #84 for concrete change.
This would have the following desirable properties:
fetch
could still fetch a Braid resource and parseVersion
,Parents
, andMerge-Type
headers.The text was updated successfully, but these errors were encountered: