You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespace query parameter vanishes when searching or sorting the Job Allocations or Job Clients tables.
Solution
refreshModel differs from passing a query argument to LinkTo or passing the query parameter in a transitionTo hook because refreshModel will ensure that the model and setUpController hook on the route will be called. Using refreshModel is considered to be a full transition and probably why we weren't seeing any of the model hooks we were expecting to be logged.
But... why are we loosing the query parameter in the first place?
Our current hunch is resetPagination or searchTerm is triggering a partial transition which we determined is true using the logger.
What's the difference between partial transitions and full transitions (i.e. refreshModel)?
refreshModel triggers queryParamsDidChange in the Ember Router which then invokes Router.refresh. This creates a map of the pre-existing query parameters - whereas a partial transition does not create a map of the old values, but just computes a set of new values based on what we have defined in our controller.
This is has been brought up by LinkedIn and is listed a Router Bug.
My prescription:
Let's use refreshModel but use a combination of Hyrum's Law and the Beyonce rule.
If you like it, you should have put a test on it.
We'll write a test that says that we're depending on this API behavior, if we upgrade Ember and the behavior changes.
Resources (Nerd Snipe):
Query Params behavior changes with RouterService when refreshModel is true #18683
pzuraq believes this issue has been ongoing since 3.13
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Issue
namespace
query parameter vanishes when searching or sorting the Job Allocations or Job Clients tables.Solution
refreshModel
differs from passing a query argument toLinkTo
or passing the query parameter in atransitionTo
hook becauserefreshModel
will ensure that themodel
andsetUpController
hook on the route will be called. UsingrefreshModel
is considered to be a full transition and probably why we weren't seeing any of the model hooks we were expecting to be logged.But... why are we loosing the query parameter in the first place?
Our current hunch is resetPagination or searchTerm is triggering a partial transition which we determined is true using the logger.
What's the difference between partial transitions and full transitions (i.e.
refreshModel
)?refreshModel
triggersqueryParamsDidChange
in the Ember Router which then invokesRouter.refresh
. This creates a map of the pre-existing query parameters - whereas a partial transition does not create a map of the old values, but just computes a set of new values based on what we have defined in our controller.This is has been brought up by LinkedIn and is listed a Router Bug.
My prescription:
Let's use refreshModel but use a combination of Hyrum's Law and the Beyonce rule.
If you like it, you should have put a test on it.
We'll write a test that says that we're depending on this API behavior, if we upgrade Ember and the behavior changes.
Resources (Nerd Snipe):
Query Params behavior changes with RouterService when refreshModel is true #18683
pzuraq believes this issue has been ongoing since
3.13
The text was updated successfully, but these errors were encountered: