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 error introduced in 487c33d5 (when trying to fix #480) #603

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

rluba
Copy link
Contributor

@rluba rluba commented Jun 5, 2018

This causes #480 to re-appear until a better handling for cancellations exists – but it’s still better than the errors caused by improper handling of redirects at the moment.

There’s no easy way to call next.cancel from all places that can create a redirect. I’d suggest changing redirects to add a magic value to an Error (eg. error.redirect = new Redirect(…)) and rejecting with that.

But this would require changes in several places that check for output instanceof Error to determine the kind of result.

This causes aurelia#480 to re-appear until a better handling for cancellations exists
@fkleuver
Copy link
Member

fkleuver commented Jun 5, 2018

I had a vague feeling I was missing something, but I couldn't spot it. Of course it's child routers.

I'll try to beef up the test coverage in this area before having another crack at this. Thanks for investigating this further, your information helps a lot.

@jdanyow I agree with him, the original bug is much "better" than the new bug.

@rluba
Copy link
Contributor Author

rluba commented Jun 6, 2018

With the changes in this PR it’s better than both the original state (because there are no warnings for redirects in app routers) and the current state (because there are no exceptions for redirects in child routers). So I think it’s worth merging instead of reverting 487c33d.

@fkleuver
Copy link
Member

@jdanyow @EisenbergEffect Please merge this. I broke production apps with this (sorry about that!). See #480

@davismj davismj merged commit 4fac9cf into aurelia:master Jun 19, 2018
@rluba rluba deleted the fix/substate_redirects branch June 27, 2018 13:43
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

Successfully merging this pull request may close these issues.

3 participants