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

fix: Handles failed events for #223. #232

Merged
merged 12 commits into from
Aug 22, 2018
Merged

fix: Handles failed events for #223. #232

merged 12 commits into from
Aug 22, 2018

Conversation

ryasmi
Copy link
Member

@ryasmi ryasmi commented Aug 21, 2018

This PR inserts failed events into the "mdl_logstore_xapi_failed_log" table as described in my comment on issue #223. This allows failed events to be reported back to us and fixed, at which point the installer can update their plugin and move the events back into the "mdl_logstore_xapi_log" table for re-processing. Note that this currently only happens in background mode. A separate PR should be made at a later date to do this for non-background mode.

In future this could be further improved by validating statements in the transformer and setting the transformed property on events to false when statements are invalid. This would ensure that invalid statements aren't sent to the LRS, therefore these invalid statements can be added to the failed log for later re-processing and one invalid statement in a batch would not fail all of the events in the batch.

  • @ht2 if you have a second can you code review this please?
  • @VassAngels can you test this with your Moodle instance using the Cron script please? (I actually tested this today - Wed 22nd Aug 2018 - see check list below)

Initially let's test the following without changing any code.

  • Supported events get inserted to the LRS
  • Supported events are removed from the "mdl_logstore_xapi_log" table.
  • Supported events are not inserted into the "mdl_logstore_xapi_failed_log" table.
  • Unsupported events are removed from the "mdl_logstore_xapi_log" table.
  • Unsupported events are not inserted into the "mdl_logstore_xapi_failed_log" table.

Then let's insert errors into a transformer and trigger the event.

  • Events with errors in their transformer are removed from the "mdl_logstore_xapi_log" table.
  • Events with errors in their transformer are inserted into the "mdl_logstore_xapi_failed_log" table.

Then let's insert errors into the LRS loader and trigger some events.

  • Events are removed from the "mdl_logstore_xapi_log" table.
  • Events are inserted into the "mdl_logstore_xapi_failed_log" table.

@ryasmi ryasmi added the fix label Aug 21, 2018
@ryasmi ryasmi merged commit 6e33b63 into master Aug 22, 2018
@ryasmi ryasmi deleted the handle-failed-events branch August 22, 2018 09:39
@HT2Bot
Copy link
Member

HT2Bot commented Aug 22, 2018

🎉 This PR is included in version 3.14.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants