X Tutup
Skip to content

fix(router): preserve specificity for redirects#5933

Closed
btford wants to merge 1 commit intoangular:masterfrom
btford:router-fix-redirect-speficificity
Closed

fix(router): preserve specificity for redirects#5933
btford wants to merge 1 commit intoangular:masterfrom
btford:router-fix-redirect-speficificity

Conversation

@btford
Copy link
Copy Markdown
Contributor

@btford btford commented Dec 16, 2015

Previously when comparing which of multiple possible routes to choose in an ambiguous case, we looked at the specificity of the target of redirect matches rather than the original match. This meant that if a redirect used a wildcard, but redirected to a target that was a static path, we'd count the static path's specificity instead of the wildcard.

This change stores the specificity of the redirect on the RedirectInstruction.

@btford btford added pr_state: LGTM action: merge The PR is ready for merge by the caretaker labels Dec 16, 2015
@btford
Copy link
Copy Markdown
Contributor Author

btford commented Dec 16, 2015

Got an in-person LGTM from @matsko

@mary-poppins
Copy link
Copy Markdown

Merging PR #5933 on behalf of @mprobst to branch presubmit-mprobst-pr-5933.

@alexeagle
Copy link
Copy Markdown
Contributor

presubmit job failed:

Failures:
1) Router should replace history when triggered by a hashchange with a redirect
  Message:
    Expected [ 'hash: a' ] to equal [ 'hash: a', 'replace: /b' ].
  Stack:
    Error: Expected [ 'hash: a' ] to equal [ 'hash: a', 'replace: /b' ].
        at Object.next (/home/travis/build/angular/angular/dist/js/cjs/angular2/test/router/router_spec.js:89:68)
        at null._onTimeout (/home/travis/build/angular/angular/dist/js/cjs/angular2/src/facade/async.js:121:110)
        at Timer.listOnTimeout (timers.js:92:15)
Pending:

@btford
Copy link
Copy Markdown
Contributor Author

btford commented Dec 21, 2015

Hm, let me rebase and try again.

Previously when comparing which of multiple possible routes to choose in
an ambiguous case, we looked at the specificity of the target of redirect
matches rather than the original match. This meant that if a redirect
used a whilecard, but redirected to a target that was a static path,
we'd cound the static path's specificity instead of the wildcard.

This change stores the specificity of the redirect on the RedirectInstruction.
@btford btford force-pushed the router-fix-redirect-speficificity branch from 77fee7a to 4e6c4a8 Compare December 21, 2015 18:47
@btford
Copy link
Copy Markdown
Contributor Author

btford commented Dec 21, 2015

Looks like there was a merge conflict in master. Resolved the issue with this PR.

@alexeagle can we try merging this again?

@alexeagle
Copy link
Copy Markdown
Contributor

You are the caretaker!

On Mon, Dec 21, 2015 at 1:05 PM Brian Ford notifications@github.com wrote:

Looks like there was a merge conflict in master. Resolved the issue with
this PR.

@alexeagle https://github.com/alexeagle can we try merging this again?


Reply to this email directly or view it on GitHub
#5933 (comment).

@mary-poppins
Copy link
Copy Markdown

Merging PR #5933 on behalf of @alxhub to branch presubmit-alxhub-pr-5933.

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup