ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

[3.13] Query Params not updating when refreshing route

Open jrohrbaugh opened this issue 6 years ago • 3 comments

Ember-twiddle with a simplified re-creation of the issue github repo with a new ember app containing the same code

We've been using the route's refresh method (documented here) to reload the route's model. refresh gets called by a route action, which is in turn called by a controller action. The controller action modifies the value of a query param, which is then accessed via the route model hook's params argument.

We noticed a change in this pattern's behavior when upgrading from 3.12 to 3.13. The model hook is no longer picking up the updated query-param value; it's using the original value instead. Ember-twiddle doesn't support recent Ember versions, so the logs there are giving the expected result. I created a fresh app using the same code: it defaulted to 3.11 and I observed the expected result, then I upgraded to 3.13 and the result changed. See the difference in the query param's value here:

ember 3 11 ember 3 13

While debugging, I was able to get the expected behavior on 3.13 by wrapping the call to the refreshRoute action inside of a setTimeout of 0ms - going from

this.send('refreshRoute');

to

setTimeout(() => {
   this.send('refreshRoute');
}, 0);

so this could possibly be a queuing issue?

jrohrbaugh avatar Oct 11 '19 02:10 jrohrbaugh

Hi!

I'd the same problem in ember 3.14

solutions??

eliel-jr avatar Feb 14 '20 19:02 eliel-jr

We are facing same problem in version ember 3.16

ahmetemrekilinc avatar Feb 25 '20 11:02 ahmetemrekilinc

We just updated our ember version to 3.20 and are still experiencing the issue. We'll probably just end up refactoring our code to not use query params under these specific circumstances

jrohrbaugh avatar Oct 15 '20 16:10 jrohrbaugh