Separate chainAdapterReady from chainModuleReady. #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We use a global Subject called "app.chainReady" in dynamic components to wait until the entire chain has initialized before loading additional dynamic data.
This Subject was also being used in the SubstrateAccounts module to handle deferred initialization of the "ChainInfo" module, i.e. the SubstrateChain class. However, the app.chainReady waits for the entire chain adapter to load, not just the
app.chain.chain
module.To fix this, I separated it into two different Subjects:
app.chainAdapterReady
(same as originalapp.chainReady
), andapp.chainModuleReady
(used in Accounts and possibly other future modules to defer initialization).Motivation and Context
This bug was causing loading errors on production: the
app.chainReady
wouldn't load until theSubstrateCollective
module loaded, but theSubstrateCollective
module assumes that account deferred initializations have already resolved (i.e. that theapp.chainModuleReady
has resolved), so it finds itself unable to query for balances and throws an error.How Has This Been Tested?
Reproduced bug in dev environment, verified fix.
Types of changes
Checklist: