Skip to content

Child routes cannot re-use param names of parent routes #17159

Open
@runspired

Description

@runspired

The following is either a bug in behavior or a bug in the sense that we are missing an assertion on a key constraint of the router.

Twiddle: https://ember-twiddle.com/84ca6381ddc9ed65dffe9916a102e7f0?openFiles=twiddle.json%2C&route=%2Fparent%2F1%2Fchild%2F1

Setup

  this.route('parent', { path: 'parent/:id' }, function() {
    this.route('child', { path: 'child/:id' });
  });
{{#link-to 'parent.child' '1' '2'}} Go to 'parent/1/child/2' {{/link-to}}

Expected Outcome

  • link-to points to the url /parent/1/child/2
  • id param given to parent is 1
  • id param given to child is 2
  • url after transitioning is updated to /parent/1/child/2

Observed Outcome

  • [BUG] link-to points to the url /parent/2/child/2
  • id param given to parent is 1
  • id param given to child is 2
  • [BUG] url after transitioning is updated to /parent/1/child/1

*Note that the urls are different in both places, the bug is inconsistent as to which id is accidentally used for both params.

Versions Affected

All versions of Ember seem to be affected.

Debugging I've found this has been either a bug or an un-asserted constraint since at least Ember 2.12.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions