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

queryParams array attribute becomes a string if other attribute changes before model is resolved #15611

Closed
mpugach opened this issue Aug 30, 2017 · 7 comments

Comments

@mpugach
Copy link

mpugach commented Aug 30, 2017

See this twiddle please.

There are two queryParams:

  • categories array
  • searchQuery string

The model resolves the current time with a 1-second timeout.

Steps:

  1. Open the console and see the current value of categories.
  2. Add at least one category by hitting the "Add category" button (do not enter anything into the text input on this stage).
  3. Observe categories is still an array in the console.
  4. Enter any text into the input field.
  5. If the searchQuery is modified before the transition completes, the categories becomes a string. From this point, it becomes even worse with every modification because it escapes escape symbols on every iteration.
@MikiDi
Copy link

MikiDi commented Aug 31, 2020

I can confirm above issue (with Ember 3.17, Firefox 79.0).

Steps to reproduce:

  • define 2 query params as described above
  • Have some change to the array content trigger a model reload (make sure it's not in the default state, so it appears in the URL)
  • In the beforeModel-hook, make a change to the searchQuery string ("the other query param")

From this point on, you should see the array query param getting escaped recursively

@rreckonerr
Copy link
Contributor

Can you please check if #19236 fixes the issue?

@mpugach
Copy link
Author

mpugach commented Nov 7, 2020

@rreckonerr, thank you for your contribution!

Have you tried modifying twidle.json? Because constructing the dummy application locally in the nearest future is too much for me.

@rwjblue
Copy link
Member

rwjblue commented Nov 11, 2020

@rwjblue
Copy link
Member

rwjblue commented Nov 11, 2020

This seems like the same as what @mfeckie is working on over in #19145.

@sly7-7
Copy link
Contributor

sly7-7 commented Mar 6, 2021

@rwjblue I've reproduced your twiddle in https://github.com/sly7-7/ember-repro-15611 (ember 3.25.1), and it looks like this is fixed.
So I guess this could be closed, and #19145 maybe not necessary

@rwjblue
Copy link
Member

rwjblue commented Mar 7, 2021

Thanks @sly7-7!

@rwjblue rwjblue closed this as completed Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants