Open mgallag opened 2 years ago
Potentially related issues: https://github.com/emberjs/ember.js/issues/19611, https://github.com/emberjs/ember.js/issues/16349
Would it be possible to introduce a param to stop this behavior? The refresh
method allows us to pass a route name in and only refresh that model and descendants, not parents. https://api.emberjs.com/ember/4.4/classes/RouterService/methods/transitionTo?anchor=refresh
This is caused by https://github.com/emberjs/ember.js/issues/19493. The router redirects to the new query params which aborts the original transition.
I applied my workaround to your repro and all tests pass. Upgrading to ember 4.4 should also fix it.
I don't know when this came back (or if it was ever truly fixed), but I just ran into this issue with ember-source 5.6, also related to https://github.com/emberjs/ember.js/issues/20512 . Either using a LinkTo, the private -routing
service's transitionTo method or removing the default query parameter value appears to "fix" the issue. None are true solutions I think.
π Describe the Bug
Initiating a transition using
<LinkTo>
or any deprecated transition method after callingRouterService.transitionTo()
causes an aborted transition which triggers a full route refresh.Precondition:
π¬ Minimal Reproduction
Repro with tests: https://github.com/mgallag/repro-transition-abort
/parent/child-a/
π Actual Behavior
parent.child-a
,parent.child-b
, andparent.child-c
parent.child-b
andparent.child-c
is aborted and a full route transition ofparent.child-c
is performed.parent
route's model hook is called twiceπ€ Expected Behavior
parent.child-a
,parent.child-b
, andparent.child-c
parent
route's model hook is only ever called onceπ Environment
β Additional Context