Triage fixes for LTI score passback bug #1560
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.
The bug:
As of
v10.0.1-rc.1
and a database running MySQL 8, there appears to be a bug associated with theDB
session driver where values written to user sessions don't persist. Specifically, thelti-link-<play_id>
values written when a user replays an instance in an LTI context goes missing. This has multiple downstream impacts, most importantly that upon submission, a replay isn't considered an LTI play and the score is not returned to the LTI provider. It's not yet clear if the underlying cause is related to:Until the core issue can be identified, this PR serves as a stopgap measure. Changes include:
scoreScreenUrl
in thewidget-player
component to useuseRef
instead of state. While this didn't fix the core issue, it potentially alleviates a race condition.auth
andenvironment_data
values to the\Materia\Session\Play
instance properties when requested viaget_by_id
. These are were not previously included in the DB query.ltievents
class when requestinglti-link-<play_id>
from session. If the token value is not present in session, it interrogates (or creates and then interrogates) a play instance for theauth
andenvironment_data
properties. The play's environment data will include thetoken
value that was supposed to be stored in session.