You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Adapt.wait API has begin() and end() calls but in cases where calls to begin() do not have a corresponding call to end() (for whatever reason) it can result in a course failing to load and difficult to diagnose errors.
Your environment
Adapt Framework v3.5.3
Steps to reproduce
Inside a plugin call Adapt.wait.begin() and do not call Adapt.wait.end().
Expected behaviour
After a given timeout, the queue should be flushed together with a debug message logged to the console to indicate as such.
Actual behaviour
The Adapt content appears to get stuck in an intermediate state between loading and rendering.
The text was updated successfully, but these errors were encountered:
brian-learningpool
changed the title
Should Adapt.wait have a timeout?
Adapt.wait should implement a timeout in order to prevent blocking of rendering
May 21, 2019
Just discussed this with @oliverfoster on Gitter chat. Adapt.wait.for(callback) (and correctly handling the error callback) would have prevented this, but it does make sense to add a timeout.
A 7-second timeout (as used by RequireJS) would be sufficient. This should be reset on every call to begin(). Also, calls to this.end should be wrapped in a _.once().
To prevent an unhandled expection or a call to begin() not having a corresponding end() from blocking rendering of the Adapt content, a 7-second timeout is now added on every begin. If the time has elapsed since the last begin() the outstanding calls to Adapt.wait.end() will be triggered.
Also added a _.once() call to the for() callback and replaced double quote marks in strings with single quotes.
Subject of the enhancement
The
Adapt.wait
API hasbegin()
andend()
calls but in cases where calls tobegin()
do not have a corresponding call toend()
(for whatever reason) it can result in a course failing to load and difficult to diagnose errors.Your environment
Adapt Framework v3.5.3
Steps to reproduce
Inside a plugin call
Adapt.wait.begin()
and do not callAdapt.wait.end()
.Expected behaviour
After a given timeout, the queue should be flushed together with a debug message logged to the console to indicate as such.
Actual behaviour
The Adapt content appears to get stuck in an intermediate state between loading and rendering.
The text was updated successfully, but these errors were encountered: