Pioneer: Improve proposal details loading flow#1149
Merged
mnaamani merged 1 commit intoJoystream:masterfrom Aug 11, 2020
Merged
Pioneer: Improve proposal details loading flow#1149mnaamani merged 1 commit intoJoystream:masterfrom
mnaamani merged 1 commit intoJoystream:masterfrom
Conversation
Member
|
The improvement is noticeable and greatly improves the wait time/experience. |
mnaamani
approved these changes
Aug 11, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addresses an issue with slow proposal details page loading due to the fact that
api.rpc.state.getKeysused to fetch all proposal votes is taking quite a long time on the current testnet (~6s during my tests) and blocks other queries that we try to execute simultaneously.The fix is about:
api.rpc.state.getKeysand be able to display this data before everything else is loaded.useProposalSubscriptionto avoid executing queries twice during first loadThis fixes the issue only partially, because the votes and proposal discussion will still take quite some time to load. Currently I can't think of any better way of fetching those, but perhaps this will be better optimized in Substrate 2.0 (as the new api provides a standarized way of fetching double-map entries by frist key).
The proposal state should still update after each council member vote without the need to refresh the page.