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

Fix followRedirects when source is async and destination is sync #335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 16, 2023

  1. Fix followRedirects when source is async and destination is sync

    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
    davidtaylorhq committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    787cfbe View commit details
    Browse the repository at this point in the history