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

Responding with a 404 from basic LRS implementation causes getState to fail #121

Open
jimjoes opened this issue May 24, 2023 · 0 comments
Open
Labels

Comments

@jimjoes
Copy link

jimjoes commented May 24, 2023

Subject of the issue/enhancement/features

I'm rolling my own (very simple) xapi endpoint and trying to get a course that uses this plugin to work. It's failing on the initial get state call. The xapi response to a get request to the activities/state endpoint when the state doesn't exist is a 404 with no body. The code here seems to be assuming the objects passed to the callback function are error and the xhr object, respectively. But, as far as I can tell, the xapiwrapper function passes the xhr object and the response... As the xhr object is always there, it seems the code block I've linked to always evaluates to true, which would appear to be incorrect, unless I've misunderstood something - I think that's why the course is failing to initialise? That being said, this comment appears to contradict my thinking, so I'm not sure how to proceed.

Your environment

5.31.7

Steps to reproduce

  1. Create new course
  2. Add xapi plugin and configure for xapi endpoint that replies with a 404 to the activities/state path if no state is found.
  3. Publish course.
  4. Browse to the course.

Expected behaviour

I would expect the 404 to be handled gracefully and for the course to post a 'virgin' state object

Actual behaviour

The GET method fails and the course hangs.

Screenshots (if you can)

error error
@swashbuck swashbuck added the bug label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants