Route's lazy loading engine not parsing queryParams of type `array`
- Dominant language
- TypeScript
- Stars
- 22.6k
- Forks
- 4.2k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 15
Description
I wasn't able to find an issue around the problem that me and my team were running into, thus I'm creating a new issue here.
Please see:
https://github.com/alias-mac/ember-engines-demo
for an example of the bug.
Go to:
http://localhost:4200/foo?category=test&filter=[1,2,3]&complexFilter={%22something%22:%22useful%22}
and compare the `console.log` output with the lazy loaded engine:
http://localhost:4200/admin-section/foo?category=test&filter=[1,2,3]&complexFilter={%22something%22:%22useful%22}
If the engine is not set as lazy loaded, it will work fine, because ember will go through all the available handlers of the routes and verify if any of the queryParams need to be parsed. When it is a lazy loaded engine, then the handlers won't exist until the route of the "mount" is hit, but due to:
https://github.com/emberjs/ember.js/blob/470dddb9bbea32f0bf71219740b22c8dc8ecf68d/packages/ember-routing/lib/system/route.js#L2351-L2361
it will not parse it again and just returned the `state.fullQueryParams` that were cached before.
A quick hack is provided in the demo:
https://github.com/alias-mac/ember-engines-demo/blob/master/lib/admin-section/addon/routes/foo.js#L19-L22
Where we are reseting the cache in beforeModel to try to bypass this problem.
What is the correct/better approach here? Or is this a valid bug?
Contributor guide
Assessment
This issue has not been assessed yet.