question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

You attempted to update `numRunning` on `<Task:[TASK_NAME]>`, but it had already been used previously in the same computation.

See original GitHub issue

Hey there, I’m getting some strange error when trying to use the isRunning property on the Task (not the TaskInstance)

This is the full error:

backburner.js:352 Error: Assertion Failed: You attempted to update `numRunning` on `<Task:renderStructure>`, 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.

numRunning` was first used:

- While rendering:
  
  application
    brands
      brands.brand-version
        brands.brand-version.print-store
          application
            designs
              business-card-sample
                this.renderStructure.isRunning

Stack trace for the update:
    at dirtyTagFor (validator.js:541)
    at markObjectAsDirty (index.js:546)
    at notifyPropertyChange (index.js:584)
    at Object.set (index.js:1530)
    at Class._startTaskInstance (-scheduler.js:106)
    at Class._flushQueues (-scheduler.js:81)
    at Class.schedule (-scheduler.js:63) undefined

My code looks like this:

{{#if this.renderStructure.isRunning}}
   // ... Do stuff
{{/if}}
<ChildComponent @renderStructure={{this.renderStructure}}/>
<ChildComponent @renderStructure={{this.renderStructure}}/>

I have a parent component that passes the task renderStructure to two identical child components. I want to able to tell once all child component finish processing.

My env: ember-cli: “3.20.0” ember-source: “3.20.5” ember-concurrency: “1.3.0”, ember-concurrency-decorators: “2.0.1”,

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:12
  • Comments:9

github_iconTop GitHub Comments

12reactions
yoavfrancocommented, Oct 8, 2020

In the meantime I’ve done a very poor workaround (that works) by replacing this:

{{#if this.renderStructure.isRunning}}
   // ... Do stuff
{{/if}}

With this:

{{#if (not (eq this.renderStructure.performCount 2))}}
   // ... Do stuff
{{/if}}
1reaction
maxfierkecommented, Oct 9, 2020

hmmm… nothing stands out as problematic there. If you could put together an Ember Twiddle, a failing test, or a GitHub repo that reproduces it, that would be aces! Otherwise, I can try to put something together in the next week or so to see if I can reproduce it and dig into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When to update model before view - General
DEPRECATION: You attempted to update `content` on `PromiseManyArray`, but it had already been used previously in the same computation.
Read more >
Cannot update tracked property via did-update in Ember JS
I am trying to use did-update in my template to trigger an action within my component from another component. I have done this...
Read more >
Derived State
ember-concurrency gives you the concept of Tasks, and when you perform a Task, it produces a Task Instance, which represents a single execution...
Read more >
yoember.com: Ember.js Octane Tutorial - From beginner to ...
It is almost the same as plain html, but you could have dynamic ... You can update your app.scss file to add some...
Read more >
Ember.js Octane vs Classic Cheat Sheet
Component templates and JavaScript are in the same directory. §. The location of component templates has changed in Octane. This is known as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found