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

Changed from default queryParamsDidChange to custom one, stopping cer… #172

Conversation

AddisonSchiller
Copy link
Contributor

Refs: https://openscience.atlassian.net/browse/SVCS-393

Purpose

Fix TransactionAborted rejected promise error and Unhandled Promise error detected.

Summary of changes

setting a queryParams refreshModel variable to true causes Ember's defualt queryParamsDidChange function to fire multiple times, causing these errors.

Added a custom queryParamsDidChange which will only fire the refresh command once.

See commit message for more info.

Links from commit message:
issue: emberjs/ember.js#5566 (old version of ember)
file where queryParamsDidChange is defined: https://github.com/emberjs/ember.js/blob/lts-2-8/packages/ember-routing/lib/system/route.js

Testing notes

…tain page refeshes from going through and causing promises to be rejected. Certain actions would trigger the function multiple times. Adding the Ember.run.once() function around it stops this from happening.

Setting refreshModel to true under queryParams is what is calling this function.
See the querryParamsDidChange function in https://github.com/emberjs/ember.js/blob/lts-2-8/packages/ember-routing/lib/system/route.js .
See emberjs/ember.js#5566 for more info on the issue, and more possible fixes.
This fix could possibly change some interactions on this route in the future (more queryParams added). If old function is desired, just comment out the new one, and ember will use its default.
For future reference there may be other possible fixes with observers that do not override the default queryParamsDidChange function.
@felliott felliott closed this in 8a4b09e Aug 8, 2017
felliott added a commit that referenced this pull request Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant