Skip to content

4.1.4-Concurrency.js incorrectly tests 409 on Activity State Resource for PUT without concurrency headers #282

@chomatdam

Description

@chomatdam

Repository: adlnet/lrs-conformance-test-suite (branch LRS-2.0)
File: test/v2_0/4.1.4-Concurrency.js

Description

The xAPI 2.0.0 concurrency test (4.1.4-Concurrency.js) applies the "PUT without concurrency headers → 409 Conflict" check to all three document resources including Activity State. This contradicts the spec, which explicitly exempts State from requiring concurrency headers.

Spec reference

xAPI-Communication.md, Section 3.1 – Concurrency (identical in both 1.0.3 and IEEE/2.0.0):

Client Requirements
The State Resource will permit PUT, POST and DELETE requests without concurrency headers, since state conflicts are unlikely. The requirements below only apply to Agent Profile Resource and Activity Profile Resource.

The "requirements below" include (3.1.s4.b13):

If a PUT request is received without either header for a resource that already exists, the LRS:

  • MUST return HTTP status 409 Conflict.
  • ...

Since this requirement falls under "the requirements below" which "only apply to Agent Profile Resource and Activity Profile Resource", the 409 requirement does not apply to the State Resource.

The problem

In test/v2_0/4.1.4-Concurrency.js, the shared function runConcurrencyTestsForDocumentResource() includes the "PUT without headers → expect 409" test (line 204–242). This function is called for all three resources at lines 257–259:

runConcurrencyTestsForDocumentResource("Activity State", xapiRequests.resourcePaths.activityState, stateParams);       // ← should not test 409
runConcurrencyTestsForDocumentResource("Activity Profile", xapiRequests.resourcePaths.activityProfile, activityProfileParams);  // ✓ correct
runConcurrencyTestsForDocumentResource("Agents Profile", xapiRequests.resourcePaths.agentsProfile, agentsProfileParams);        // ✓ correct

The 1.0.3 version of this test (test/v1_0_3/H.Communication3.1-Concurrency.js) correctly handles this — it only tests the 409 behavior against Activity Profile, not State.

Expected behavior

The "PUT without headers → 409" test block (lines 204–242) should be skipped for the Activity State resource, since the spec explicitly permits PUT/POST/DELETE without concurrency headers on State.

Suggested fix

// before
runConcurrencyTestsForDocumentResource("Activity State", xapiRequests.resourcePaths.activityState, stateParams);
runConcurrencyTestsForDocumentResource("Activity Profile", xapiRequests.resourcePaths.activityProfile, activityProfileParams);
runConcurrencyTestsForDocumentResource("Agents Profile", xapiRequests.resourcePaths.agentsProfile, agentsProfileParams);

// after - 409 tests only for Profile resources (not State, per spec 3.1.s3)
runNoHeaderConflictTests("Activity Profile", xapiRequests.resourcePaths.activityProfile, activityProfileParams);
runNoHeaderConflictTests("Agents Profile", xapiRequests.resourcePaths.agentsProfile, agentsProfileParams);

Being a simple fix, I'm only opening an issue to validate the understanding is correct, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions