Skip to content
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

sendActivityProfile function using If-Match and LearningLocker LRS #78

Open
iamspeeddevil73 opened this issue Feb 13, 2017 · 1 comment

Comments

@iamspeeddevil73
Copy link

iamspeeddevil73 commented Feb 13, 2017

I have a question about the sendActivityProfile functiion. When passing an object as the profileval the function will always use the POST method.

Unfortunately, when using POST the LearningLocker LRS will ignore the If-Match header and will always store the data sent even if it overwrites an updated profile object. If I modify the code so that it uses PUT, LearningLocker behaves as expected and returns http status 412 - precondtion failed.

Just wondering what the correct behaviour here should be? Is this a fault with the wrapper or the LRS?

And what is the reason POST always being used when profileval is an object but not if profileval is an array? Of the top of my head I would expect POST when creating a new profile and PUT when updating an existing profile, why should the method be dependent on the profile data type?

@ljwolford
Copy link
Contributor

ljwolford commented Feb 21, 2017

For now, POSTs without the etag headers are allowed and the expected behavior from the LRS is to merge the JSON documents together, and overwrite any existing fields with that of the incoming profile so that sounds like it is working correctly on their end. While using If-Match with PUT, as long as the etag value matches the existing document, it should overwrite it.

I will look into the weird behavior with the wrapper regarding objects/arrays. I'm not sure why the profile data type is having any say in what the method will be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants