emberjs / emberjs/router.js

Calling recognize should not affect the transition.from query params for subsequent transitions

Open
#337 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.3k
Forks
159
PR merge metrics
No merged PRs in 30d

Description

Calling `router.recognize` with a URL which matches the current route affects the `transition.from.queryParams` for subsequent transitions. I've created a [PR with a failing test here](https://github.com/tildeio/router.js/pull/336).

Root cause seems related to the fact that `toReadOnlyRouteInfo` ([source](https://github.com/tildeio/router.js/blob/9320c7b1c1e887e73afd3700cd0093b9f34c9e6b/lib/router/route-info.ts#L63)) closes over a WeakMap for `ROUTE_INFOS` which is then mutated on subsequent calls (including calls from router.recognize). I don't know the original intent here so I'm not sure the solution.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.