'run to completion' error if exception thrown in task
@restartableTask
*_debounce(this:MyClass) {
yield timeout(250);
this._doWork();
}
This gives an assertion error if this._doWork throws. In my case it was using a non existent variable.
Assertion Failed: The task generator function has already run to completion. This is probably an ember-concurrency bug.
@BryanCrotaz can you reproduce in a Twiddle?
No. It gives the correct missing variable error. My guess is it's some combination of typescript/ES6/ember-concurrency-decorator.
If I fix the missing variable typo in my code the problem goes away.
Are you using ember-cli-typescript or ember-cli-babel with TypeScript compatibility?
Is it only with @restartableTask or @task as well?
What about...?
@restartableTask
_debounce = function*(this: MyClass) {
yield timeout(250);
this._doWork();
}
I know that Babel had / has trouble with decorating generator methods, as in your example. The initializer form, as shown above, has always worked so far.
If this is not the cause, maybe it's the this type?