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

Errors on certain route transitions #83

Open
galfert opened this issue Jan 15, 2017 · 1 comment
Open

Errors on certain route transitions #83

galfert opened this issue Jan 15, 2017 · 1 comment

Comments

@galfert
Copy link

galfert commented Jan 15, 2017

I noticed that ember-perf throws errors on certain route transitions.

The first one is thrown when transitioning between routes with the same name but different params (e.g. from /articles/1 to /articles/2). The error is:

Cannot set property 'endTime' of undefined TypeError: Cannot set property 'endTime' of undefined at TransitionData.routeFinishedSetup

which is thrown in

r.endTime = endTime;

I think the reason for this is that activateRoute from

prototype.activateRoute = function activateRoute(route) {
is never called on this transition, and thus this.routes stays empty.

The second error happens when transitioning between routes with the same name, but different query params (e.g. from /bookmarks?category=news to /bookmarks?category=politics).
The error is

Assertion Failed: Must have at least a route name

which is thrown in

assert('Must have at least a route name', transitionRoute);
.

I created a basic Ember app at https://github.com/galfert/ember-perf-bugs that reproduces these two errors.

@galfert
Copy link
Author

galfert commented Jan 16, 2017

I was able to prevent the first error by changing this.get('perfService').routeActivated(this); to get called from setupController() instead of activate() in

activate() {
.

I think setupController is the next in line of route hooks after activate, but it gets called every time. Not sure this change has any other implications though.

It also doesn't prevent the second error from happening.

ryanlabouve added a commit to ryanlabouve/ember-perf that referenced this issue Apr 17, 2018
> The first one is thrown when transitioning between routes with the same name but different params (e.g. from /articles/1 to /articles/2). The error is:

mike-north#83
ryanlabouve added a commit to ryanlabouve/ember-perf that referenced this issue Apr 17, 2018
This fixes the bug:

> The first one is thrown when transitioning between routes with the same name but different params (e.g. from /articles/1 to /articles/2). The error is:

ref mike-north#83
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

No branches or pull requests

1 participant