Re: Resumable Upload draft updates

Toomim:
>> 1. What is the parent version of a resource that a client is 
>> uploading to? Requests have to set this header to ensure they are 
>> appending at the correct offset, but I am wondering what parent 
>> version would be included in responses to HEAD requests. The example 
>> responses in section 3.3 always use the 0 byte count.
>
> Ah, yes... Well, the parent header is actually redundant in that case— 
> so I'm removing it from the example.
>
> There, I think this 
> <https://github.com/braid-org/braid-spec/commit/9e9485cdd4d2adcb0e7898b13919b06dc12ec496> 
> is clearer now. How about you?
>
Ohh... I think the reason for the parents header is actually to support 
multiple uploaders at the same time.

Consider the case where Bill and Ted stream-upload themselves to 
/phonebooth at the same time. In a sense, we can then consider 
/phonebooth to have forked in time:

                genesis
                 /  \
                /    \
            bill-0   ted-0
               |      |
            bill-1   ted-1
               |      |
            bill-2   ted-2
               |      |
              ...    ...

Eventually, one or both of the streams will `end`, and then maybe one or 
both will merge to master and become the official value of /phonebooth.

But in the meanwhile, while they are uploading, it's nice for the 
clients and servers to keep track of which fork of time they are on. 
That's why the client's HEAD request for "how much has been uploaded?" 
specifically signals which parent it's concerned with:

    HEAD /phonebooth
    Parents: "ted-0"

This constrains the server to only give updates parented by the "ted-0" 
line of history.

Very good questions to be asking!

Michael

Received on Thursday, 25 July 2024 11:25:35 UTC