Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with performCount on Ember v3.15 #337

Closed
Turbo87 opened this issue Dec 10, 2019 · 10 comments · Fixed by #338
Closed

Issue with performCount on Ember v3.15 #337

Turbo87 opened this issue Dec 10, 2019 · 10 comments · Fixed by #338

Comments

@Turbo87
Copy link
Contributor

Turbo87 commented Dec 10, 2019

We tried to update our app to Ember 3.15 this morning and the test suite of one of our apps uncovered the following issue:

Assertion Failed: You attempted to update performCount on <(unknown):ember22520>, 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.

performCount was first used:

  • While rendering:
    (instance of a (unknown function) modifier)

Stack trace for the first usage:
at get (http://localhost:7357/assets/vendor.js:39430:11)
at Class.incrementProperty (http://localhost:7357/assets/vendor.js:53987:72)
at Class.schedule (http://localhost:7357/assets/vendor.js:158913:12)
at Class._performShared (http://localhost:7357/assets/vendor.js:160316:23)
at Class.perform (http://localhost:7357/assets/vendor.js:160286:19)
at XValidatedInput._focus (http://localhost:7357/assets/vendor.js:143177:33)
at XValidatedInput.focusIn (http://localhost:7357/assets/vendor.js:143157:12)
at XValidatedInput.trigger (http://localhost:7357/assets/vendor.js:59364:23)

I haven't been able to come up with a reproduction yet, but I'll update this issue if I can provide one.

@maxfierke
Copy link
Collaborator

Seems to be triggered by this:

this.incrementProperty('performCount');

Mind giving this branch a try: #338 ?

@robclancy
Copy link

I been seeing this issue too.

@robclancy
Copy link

That branch fixes it, I have to use it now or can't release.

@maxfierke
Copy link
Collaborator

I'm having issues with the test for the fix for it on earlier Ember versions in the CI matrix, but I'll try to fix that up tonight and tag a release. I do not recommend using a branch in production.

@Turbo87
Copy link
Contributor Author

Turbo87 commented Jan 7, 2020

@maxfierke it might be possible to remove the test file from the broccoli tree depending on the ember version, but I have to admit that I'm not sure how exactly to do that either 😅

@robclancy
Copy link

I mean.. I can't not use the branch it literally breaks everything.

@Turbo87
Copy link
Contributor Author

Turbo87 commented Jan 7, 2020

that double negation is hard to parse 😅

@allthesignals
Copy link

I'm seeing something similar:
image

It's on "numQueued".

Versions:

    "ember-concurrency": "^1.1.5",
    "ember-concurrency-decorators": "^1.0.0",

code:

export default class FindModalSplit extends Helper {
  /**
   * Task that wraps async call to get modal-split record from store
   */
  @task *findModalSplitTask(geoid) {
    return yield [
      this.readonlyStore.find('ACS-modal-split', geoid),
      this.readonlyStore.find('CTPP-modal-split', geoid),
    ];
  }

  /**
   * Main helper 'compute' function
   */
  compute(params) {
    const [geoid] = params;
    if (!geoid) return null;
    return this.findModalSplitTask.perform(geoid);
  }
}

@maxfierke
Copy link
Collaborator

@allthesignals can you confirm there are no addons depending on earlier versions of ember-concurrency that might be getting used instead?

@allthesignals
Copy link

@maxfierke that was totally it! time to add https://github.com/salsify/ember-cli-dependency-lint to this project...

appreciate it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants