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
Assertion Failed: You attempted to update `isFinished` on `<Task:_resolvePromise.perform()>`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
After trying to update to 3.15 & latest ember-concurrency.
The code triggering this is a bit special, but it worked fine before:
importComponentfrom'@glimmer/component';import{tracked}from'@glimmer/tracking';import{restartableTask}from'ember-concurrency-decorators';import{timeout}from'ember-concurrency';/* * This component takes a `promise` argument and yields an object with a `value` and a `isPending` property. * Note that the `value` will only change once the passed in promise is resolved! * This means that the last value will be used until a new value is resolved - it will not f.e. switch to `null` in between or similar. */exportdefaultclassAwaitPromiseextendsComponent{/* * Arguments: * - promise */
@tracked_resolvedValue=undefined;
@tracked_isRunning=false;
@tracked_hasNeverResolved=true;
@tracked_promise=undefined;getpromiseData(){let{ resolvedValue, isPending }=this;return{value: resolvedValue,
isPending
};}getisPending(){if(!this.args.promise){returnfalse;}returnthis._hasNeverResolved||this._isRunning;}getresolvedValue(){let{ promise }=this.args;if(!promise){this._resolvedValue=undefined;this._promise=undefined;returnundefined;}let{ _resolvedValue }=this;if(_resolvedValue&&promise===this._promise){return_resolvedValue;}if(promise!==this._promise){this._resolvePromise.perform(promise);}return_resolvedValue;}
@restartableTask*_resolvePromise(promise){this._isRunning=true;// We have to wait a tick before setting _promise,// otherwise it complains that we set a property after accessing it in a getteryieldtimeout(1);this._promise=promise;this._resolvedValue=yieldpromise;yieldtimeout(1);this._hasNeverResolved=false;this._isRunning=false;}}
Usage:
<AwaitPromise @promise={{this.promise}} as |promise|>
{{#ifpromise.isLoading}}
LOADING
{{else}}{{logpromise.value}}{{/if}}
</AwaitPromise>
The text was updated successfully, but these errors were encountered:
This test tested that certain updates to internal state didn't trigger re-render assertions.
However, firing tasks inside a getter is a side-effect not really
allowed under the autotrack system, and should not be supported.
Possibly related to #337, I get
After trying to update to 3.15 & latest ember-concurrency.
The code triggering this is a bit special, but it worked fine before:
Usage:
The text was updated successfully, but these errors were encountered: