fix: Handles failed events for #223. #232
Merged
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.
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 tofalse
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.Initially let's test the following without changing any code.
Then let's insert errors into a transformer and trigger the event.
Then let's insert errors into the LRS loader and trigger some events.