-
Notifications
You must be signed in to change notification settings - Fork 405
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
Added proposed attachment feature DISCUSS BEFORE MERGE #57
Conversation
Also note: while I was writing up this feature, it struck me that particularly with the ability to POST a set of statements that all have large attachments, and the LRS potentially finding a hash mismatch on the last statement... we should provide a way for the LRS to accept some statements in a batch, and reject others, and inform the client. |
Not so related to this particular solution, but note that having an attachment mechanism, including the ability to retrieve attachment contents or not, will be of help for statement signing. A signature can be just another attachment "usageType". |
This looks good to me. A few questions:
Andrew bscSCORM notifications@github.com wrote:
|
|
Hi Ben: Thanks for the lengthy explanation. I agree with the model and see the advantages. I have a question though about this statement: Haven't we decided that batch statements would be treated as a single transaction? |
@nhruska We have decided that, I should have been clearer I was suggesting re-opening that discussion. I'm not entirely sure myself if that's the way we should go, but the attachment feature makes a very large stream of statement data more likely. The attachment feature, combined with the requirement for atomic statement batches pretty much forces LRSs to write statement data out to disk that they may eventually discard. This is probably a good idea anyway, but before the attachment requirement an LRS might have gotten away with holding statement batches in memory while validating them. So, since that requirement is being made more onerous, I thought we should consider it again. |
@bscSCORM Indeed. I'm going to post a link to this PR in the group and try to solicit some feedback. |
Only solution I can think of for this is that the LRS returns an array if failed statement ids. I guess you could do it the other way round and return succeeded statement ids. Are there any other options on the table? Nikolaus Hruska notifications@github.com wrote:
|
I think we'd want an array of objects with: statementId Including both good & bad statements, in the order they were sent. That way clients that don't set statement IDs can still figure out what the statement IDs for the good statements are (I guess the IDs would be blank for statements that don't get created). Maybe the "post multiple statements" mode should require statement IDs? Though I'm afraid that would break some clients. I think the HTTP status code for the overall request should be something non-200 if there were any failures, to make sure that clients which weren't checking for it considered the overall request a failure, seems better than the reverse. |
I think that makes sense. We could always recommend that statement IDs are included but not require it. As for the HTTP status code for the overall request, I'd love to suggest 418 but 207 seems more appropriate. Interestingly this issue seems to have already been considered, see: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes https://tools.ietf.org/html/rfc4918 I didn't yet have a chance to read the rfc. Andrew |
Some links to relevant sections of the RFC: https://tools.ietf.org/html/rfc4918#section-13 https://tools.ietf.org/html/rfc4918#section-9.6.2 Does this standard meet our needs? |
I've created this issue: #70 to continue the "atomicy" discussion, since it doesn't actually impact the proposed text in this PR, but is an additional proposed change to deal with some side effects of large statements of which attachments are one example. I suggest we merge this PR, and continue the discussion on atomicity there. I will also add an attachment example as a new PR after we merge, unless folks feel it is necessary for discussion -- if not I'd prefer to do that work against a feature we've agreed to include. |
Agreed. More frequent smaller merges FTW. bscSCORM notifications@github.com wrote:
|
@andyjohnson looks like we should be able to merge this now |
Added proposed attachment feature DISCUSS BEFORE MERGE
This is a proposal for how to handle binary data in statements.
As I wrote up the details, I change the approach from what we discussed in Alexandria, and in the email dicussion with Nik, for reasons I will describe below.
GitHub issues related to the PR:
#38
#23
Note that this proposal specifies the use of "multipart/mixed" as a transmission format to handle attachments, rather than using base64 within the json as we had previously discussed. This is a break from the model of "The transmission format of a statement matches the logical model of a statement". Breaking from the model used elsewhere in the spec will add some confusion, so we should not do it lightly. However, we do gain the following advantages:
Additionally, please note that I had discussed in an email with Nik pulling in some concepts from Activity Streams attachments. I wound up not including most of them for the following reasons:
Note, that even without the specified fields, it is possible to convert from an activity streams binary to a Tin Can binary (provided the actual data of the attachment is available). We will not be able to use this attachment feature to represent an activity streams binary object that points to a dead URL, but that could always be done in an extension. And a reference to a dead URL is of limited use.