Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] namespace query parameter vanishes when searching and sorting allocation and client tab #11327

Closed
ChaiWithJai opened this issue Oct 15, 2021 · 2 comments
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/ui type/bug

Comments

@ChaiWithJai
Copy link
Contributor

Issue

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

@ChaiWithJai ChaiWithJai linked a pull request Oct 15, 2021 that will close this issue
@lgfa29 lgfa29 added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/ui labels Oct 15, 2021
@lgfa29
Copy link
Contributor

lgfa29 commented Feb 22, 2022

Close by #12082

@lgfa29 lgfa29 closed this as completed Feb 22, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/ui type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants