As of v10.0.1-rc.1 and a database running MySQL 8, there appears to be a bug associated with the DB session driver where values written to user sessions don't persist. Specifically, the lti-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:
Changes between MySQL 5.7 and 8 that cause session writes to sometimes go bad
Issues with session rotation, specifically when the Session table is under significant load
Issues with FuelPHP 1.9 AND MySQL 8 or some combination of the above
Until the core issue can be identified, this PR serves as a stopgap measure. Changes include:
Modifies scoreScreenUrl in the widget-player component to use useRef instead of state. While this didn't fix the core issue, it potentially alleviates a race condition.
Adds auth and environment_data values to the \Materia\Session\Play instance properties when requested via get_by_id. These are were not previously included in the DB query.
Adds "triage" fallback logic to the ltievents class when requesting lti-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 the auth and environment_data properties. The play's environment data will include the token value that was supposed to be stored in session.
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.