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
TransitionAborted when performing a full route transition with changed query params #5566
Comments
@machty thoughts? |
I'm having this problem too... |
Hi guys, any update on this issue? Anything more we can provide? |
same here -- I'm getting this error |
I am also seeing this error. It's worth noting that RSVP's Ember.RSVP.on('error', function(error) {
Ember.Logger.assert(false, error);
}); |
Is this error materially affecting your guys' apps or just your tests? |
I'm seeing it in my main app. I was just testing it out—and based on this error I've just taken it out and moved on for now. |
I am also seeing this Ember.RSVP.on('error', function(error) {
Ember.Logger.assert(false, error);
}); It seems to be triggered by a route whose model is being updated every 2 seconds. |
I did some investigating, and it looks like the second call to When I comment out that line, my app seems to work normally and without errors. Seemed like a bug to me, as I'm not entirely sure I understand the reason, but is it duplicating the behavior of setting My QUnit tests failing was due to something else entirely (was setting a query param to null in the route deactivate callback, which caused the next test to fail while a transition due to the query param change was attempted). |
Experiencing this on Ember 1.8.1. Edit I can confirm that commenting the line mentioned by @skoryky fixes the problem. |
In my case I have to change multiple query params. I am still getting the console errors even after commenting out the line as suggested by @skoryky . However, other than the console errors, the app is behaving as it should. |
@shripathee, I also encountered your issue. Turns out the
|
@skoryky Yes, this works pretty fine. Thank you. |
I am also facing this issue, |
Can also confirm this on queryParams:
page:
refreshModel: true
query:
refreshModel: true |
I'm seeing the same error. |
I'm also having this issue. (Ember 1.9.0) Only on |
I'm also facing the same issue. Any updates? |
I'm putting this on the agenda for our next core team meeting. |
I'm running into this issue with Ember 1.11.0-beta.4. Updates? |
Facing this issue too. It only bugs me because it gets logged as an error -- works fine otherwise (I'm doing pagination and the pages change and everything works fine). EDIT: using Ember 1.7.0 |
Seeing this on 1.11.0-beta.1+canary.26c1084c. |
I'm facing this issue to and as @gorandev it is only logged but it does not compromise the app flow.
|
Hmm... This is the behavior that I'm trying to implement (which I'm not able to do at the moment): A user can type (normally) in a search box, which refreshes the model of a route. Currently, if I swallow the TransitionAborted errors, the typing UI doesn't respond well and will replace the text box with the finished transition. I would prefer to discard requests that pile up rather than wait for them to resolve. export default Ember.Route.extend({
queryParams: {
q: { replace: true, refreshModel: true },
sort: { replace: true, refreshModel: true },
filter: { replace: true, refreshModel: true }
},
model: function(params) {
return this.store.find('user', params);
}
} |
Looks like @piotrze's |
Please reopen this issue. It still occurs on Ember 2.6 when the queryParams have refreshModel: true |
Ember 2.7
queryParamsDidChange: function(a,b) {
// Compare to prevent refresh if nothing has changed
if(
a.page === b.page &&
a.selectionId === b.selectionId &&
a.sort === b.sort &&
a.sortDirection === b.sortDirection
){
return;
}
Ember.run.next(this, 'refresh');
} |
FYI - still seeing this in import Ember from 'ember';
/**
* Debounce Refresh
* Ember routes with queryParams that have refreshModel double-trigger a refresh:
* see: https://github.com/emberjs/ember.js/issues/5566
*
* Mix this in to routes that define queryParams[param].refreshModel to avoid the TransitionAborted error thrown when double-triggering refreshes.
*/
export default Ember.Mixin.create({
refreshDebounceThreshold: 100,
_lastRefresh: null,
_doRefresh() {
if (this._lastRefresh) {
this._lastRefresh();
this._lastRefresh = null;
}
},
refresh() {
this._lastRefresh = this._super.bind(this, ...arguments);
Ember.run.debounce(this, '_doRefresh', this.get('refreshDebounceThreshold'));
}
}); |
@jesseditson thanks for the Mixin. There's one issue, when you change the query params of a route, transition to a different page, and then come back to the page with the query params the refresh happens again and causes the error. |
@supersabillon ah, when resuming with "sticky" QPs? I've disabled those in the app I'm using, I wonder if that's why I didn't come across that case. |
There is a bug in ember's router implementation that triggers multiple route refreshes when multiple query-params are specified that are marked with the `refreshModel`-option. See this github-issue for more detailed information: emberjs/ember.js#5566 This change makes sure that NewRelic won't pickup those non-user- facing errors and rethrow an error.
still happening in 2.11.0-beta.2. |
Yes, is still happening to me also in |
…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.
…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.
* Override the default queryParamsDidChange[1] method to stop certain 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 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 (e.g. if more queryParams are added). If the old function is desired, 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. [1] https://github.com/emberjs/ember.js/blob/lts-2-8/packages/ember-routing/lib/system/route.js [SVCS-393] Fixes #172
Was this silently fixed in 2.12.0? (commit cee49a3) |
@aaxelb not intentionally, but possibly it did fix it. Is the behavior correct in 2.12? |
I reproduced the JSBin (with current Ember versions) and it does indeed seem to be fixed. https://jsbin.com/cajiji/edit?html,js,output closing.... |
This error is throwing too on doing this in a route:
Removing return keyword, fix it. |
This was happening to me in a test only, specifically after upgrading tests to the new(ish) RFC. As @cesarluis13915 said, removing |
Occured in our project with the Ember 3.11.1 upgrade. |
#18177 is this the same? |
I'm seeing this appear in error tracking service, Sentry |
@rwjblue ping |
no issues refs emberjs/ember.js#5566 (comment) Member deletion UI gets stuck in UI when deleted via these steps: View member list, filtered by label. Click on a member, delete them. Admin transitions back to previous screen before action is completed — deletion completes successfully but deletion UI hangs. This happens due to a niche ember bug which causes transitions to abort when transitioning to a route with query params having `refreshModel:true`. The fix is simple one liner with return being separated from the route transition statement.
Why does a TransitionAborted error get thrown when performing a full route transition when changing query params?
I am working off of the "Opt-in to full transition via refresh()" example provided at the bottom of the query parameters Ember guide (http://emberjs.com/guides/routing/query-params/).
The only change I made was to log errors:
Here is an updated JS Bin: http://jsbin.com/kinajoginedo/1/edit?console,output
If you click the "Change it" button, you'll see a TransitionAborted error thrown in the console.
I've been trying to upgrade Ember in my app from 1.7.0-beta.1+canary for some time now, but many of my QUnit tests fail when I run them all together. Most of my tests are fine if I run them in isolation. I suspect the TransitionAborted errors may be causing the test failures. However, I'm not sure if TransitionAborted exceptions are normal when performing full transitions. If anyone can confirm one way or the other, that would be very helpful in getting to the root cause of my problems, whatever they might be.
The text was updated successfully, but these errors were encountered: