RouteQueryManager doesn't play nice with loading substate
See original GitHub issueI have a route in my app called widgets.show
that takes an ID param. I tried adding a loading substate to my app with a template named show-loading.hbs
. Once I add this template and I transition between showing different widgets (updating the :id
route param from i.e. 1
to 2
), the following sequence of events happens:
beforeModel()
is called on thewidgets.show
route for the new ID2
. This causes theRouteQueryManager
to mark all preexisting watch query subscriptions as stale, which is good. In this case, it’s only the query for widget with ID1
that is active and thus marked stale.model()
gets called with the new ID2
, initiating the Apollo Client request and starting a subscription which is not stale.resetController()
is called on thewidgets.show
route withisExiting=true
. TheRouteQueryManager
then unsubscribes to all queries, which includes the pending query for the new widget. Thetransition
argument toresetController()
isnull
.- The new widget route never leaves the loading state because its promise is never resolved (due to the subscription being unsubscribed).
The problem here is that RouteQueryManager
uses isExiting
to determine whether it should unsubscribe to all queries, or just those that were previously marked as stale. With a loading route, the previous widgets.show
route is exited in favor of widgets.show_loading
. If I remove the loading template, isExiting
remains false and only the stale queries are removed.
I’m not sure right now how to solve this. Any ideas?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Router query object not immediately populated from dynamic ...
Bug report The router query object is not populated immediately from dynamic route params on either the server or the client.
Read more >Angular router navigate doesn't load page when query ...
'reload' : The router reloads the URL. Use to implement a "refresh" feature. In the main app routing file, set the value to...
Read more >How to build a custom blockchain implementation in Rust ...
This tutorial demonstrates how to implement a very basic, backend-based, custom blockchain application in Rust using Substrate.
Read more >Cisco's Enhanced Interior Gateway Routing Protocol (EIGRP)
When a QUERY is received for a route that doesn't exist in our topology ... met for the EIGRP reliable transport protocol to...
Read more >IColor ProRIP Software Instruction Manual
It is expected that the print mode corresponds to the loaded material or media. Substrate Color - This is the background color used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@villander Could to talk to @locks to check this possible bug in Ember?
I never updated this thread, but I did speak to @rwjblue about this at one point. He said there was really no workaround or fix for this other than to not use loading substates.