Skip to content

replaceRoute in setup sends incorrect event to queryParamsDidChange #61

@km-smith

Description

@km-smith

Ran into a weird bug when you call replaceRoute and only change query params for the current route inside the setup method. What happens is the setup method runs and the query params are changed. The subsequent call ember parachute makes to queryParamsDidChange seems to contain the original(not updated) values in queryParams but includes any updated query params in changed. This cause some weird issues with my logic which was relying on changed.

Assume we have query params foo and bar and they default to empty strings. First hit the route and setup is called where the queryParams are { foo: '', bar: '' }. Then use replaceRoute in setup and set them to { foo: 'foo', bar: 'bar' }. When queryParamsDidChange is called its queryParams will be { foo: '', bar: '' }. but its changed will be { foo: 'foo', bar: 'bar' }. Let me know if you need a full reproduction and I can toss one together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions