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

transition.send change in Ember 3.6 breaks Torii (authentication addon) #17545

Closed
kategengler opened this issue Feb 1, 2019 · 8 comments
Closed
Assignees

Comments

@kategengler
Copy link
Member

When upgrading an app from 3.5, acceptance tests started failing that ensured unauthenticated users were redirected. The app uses Torii and the authenticatedRoute feature which would hit an accessDenied action on the Route hierarchy when a user is not authenticated, in 3.6, this action is not hit.

Torii Issue: https://github.com/Vestorly/torii/issues/431

A recreation of the issue is here: https://github.com/kategengler/torii-test

This change kategengler/torii@212e6a5 fixes the recreation (but does not fix the original app 😬)

@btecu
Copy link
Contributor

btecu commented Feb 3, 2019

You can just use transition.send(false, 'actionName', ...).

@rwjblue
Copy link
Member

rwjblue commented Feb 3, 2019

@chadhietala was this an intentional change? Why did we add an argument to the beginning?

@chadhietala
Copy link
Contributor

Probably not. I can look this morning.

@chadhietala
Copy link
Contributor

I cherry-picked #17563 on to beta and release. Should resolve this issue.

@btecu
Copy link
Contributor

btecu commented Feb 17, 2019

This is better but not a complete fix.

Before I was doing something like:
transition.send('actionName', 55);

actions: {
  actionName(id) {
    // Do something with `id`
  }
}

Now the id received is false. This caused a silent failure in the application.

@crhayes
Copy link

crhayes commented Feb 21, 2019

@btecu I have a similar issue. I think the main issue is that if you pass multiple params to send, but you don't include a boolean as the first param, the second param gets lost.

ex:
transition.send('action', param1, param2, param3)

actions: {
  event(one, two, three) {
    // one == param2
    // two == param3
    // three == undefined
  }
} 

This code may be the culprit:
https://github.com/tildeio/router.js/pull/279/files

If you don't pass a boolean as the first param, it "shifts" the name param over, but not the collected args (...args)

@btecu
Copy link
Contributor

btecu commented Feb 21, 2019

@crhayes In my case I worked around it by not using transition.send at all. Perhaps you should open a new issue and mention this one.

@crhayes
Copy link

crhayes commented Feb 21, 2019

@btecu Yes I worked around my issue with transition.trigger(false, 'action', param1, param2, param3)

kellyselden pushed a commit to ember-vr/ember-aframe that referenced this issue Nov 5, 2019
kellyselden pushed a commit to ember-vr/ember-aframe that referenced this issue Nov 5, 2019
kellyselden pushed a commit to ember-vr/ember-aframe that referenced this issue Nov 5, 2019
kellyselden pushed a commit to ember-vr/ember-aframe that referenced this issue Nov 5, 2019
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

5 participants