-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
v3.6.0-beta.1: redirect causes visit
test helper to fail
#17150
Comments
Possibly related emberjs/ember-test-helpers#332 |
What I find weird, is that it used to work before. But yeah, possibly related. |
Related to #17152... |
Looks like the same as #17152. See https://github.com/wagenet/ember-transition-abort-test which passes on latest and beta, but fails on canary, as visible here: https://travis-ci.com/wagenet/ember-transition-abort-test. The commit that causes issues is 9b7e0f5, though on the face of it, it should be unobjectionable. |
Hmm, the fix above definitely addressed the reproduction that @wagenet shared but I'm not 100% sure it will fix the issue @buschtoens has. The commit that I reverted (9b7e0f5) doesn't exist in the current beta branch... @buschtoens - Can you help us track this down with a reproduction? |
The previous implementation of `followRedirects()` would catch a transition rejection and check the router for an `activeTransition`. This can become problematic in async situations because the destination transition may have resolved before the `reject` is scheduled on the previous transition. One such case is when redirecting from an async model hook to a destination route with synchronous model hooks. This commit updates the `followRedirects()` logic to explicitly follow the redirect chain rather than relying on the presence of an `activeTransition`. This makes following redirects work correctly regardless of any scheduling concerns. This problem has been noted in the context of the `visit()` test helper: - emberjs/ember-test-helpers#332 - emberjs/ember.js#17150
The previous implementation of `followRedirects()` would catch a transition rejection and check the router for an `activeTransition`. This can become problematic in async situations because the destination transition may have resolved before the `reject` is scheduled on the previous transition. One such case is when redirecting from an async model hook to a destination route with synchronous model hooks. This commit updates the `followRedirects()` logic to explicitly follow the redirect chain rather than relying on the presence of an `activeTransition`. This makes following redirects work correctly regardless of any scheduling concerns. This problem has been noted in the context of the `visit()` test helper: - emberjs/ember-test-helpers#332 - emberjs/ember.js#17150
I have a test case like:
Prior to
v3.6.0-beta.1
(v3.5.0
to be precise) this test worked.Now it fails with a
TransitionAborted
error. Adding a noop catch clause fixes it:Is this expected behavior? Do we want redirects to bubble up to the
visit
helper as aTransitionAborted
error?The text was updated successfully, but these errors were encountered: