fix: /PUT state not following spec with 409 - Conflict - #105
Open
chomatdam wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
I opened an issue regarding 2.0.0 conformance tests not matching the spec: |
milt
self-requested a review
August 10, 2026 19:17
Member
|
Thanks again @chomatdam and apologies for not getting to this sooner. I agree completely with your analysis here, it does seem to be optional for state and that is a defect. The fact that it is encoded in the conformance tests is a real problem for us too, we are currently involved in efforts to get those tests supported and hosted again as part of the I2IDL project but that will take some time. In the meantime I'm considering a runtime flag that will correct the behavior so that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
State resources (
/xapi/activities/state) were incorrectly subject to concurrency header requirements (If-Match/If-None-Match) when a document already existed. Per the xAPI 1.0.3 spec §3.1 and xAPI 2.0.0, state resources are explicitly exempt from concurrency header requirements:This meant that a second PUT to a state resource (overwriting an existing document) without concurrency headers would incorrectly return a
409 Conflictinstead of succeeding.Impact
(since last LRSQL release)
Articulate Storyline/Rise courses using
scormdriver.jsfor xAPI communication do not sendIf-MatchorIf-None-Matchheaders when updating state documents. This caused state PUT requests to fail with409 Conflictwhen a state document already existed, breaking Articulate content playback and progress tracking.Changes
src/main/com/yetanalytics/lrs/pedestal/routes/documents.cljcparams-typeis:xapi.activities.state.PUT.request/params, PUTs without concurrency headers are allowed regardless of whether a document already existssrc/test/com/yetanalytics/lrs_test.cljAdded
document-concurrency-testthat validates version-aware concurrency behavior: