DigixGlobal / governance-ui-components

Governance UI reusable components library
Other
3 stars 2 forks source link

[FIX] Fix timing issue with fetching data from dao-server #334

Closed mandres-digix closed 5 years ago

mandres-digix commented 5 years ago

We have been getting issues where currentUser is null when we fetch data from the dao-server after loading a wallet. This is due to certain components in the sidebar (renderDisplayName and renderAdminItem) that try to fetch data before the authorization headers have been set. They are re-rendered when the ChallengeProof is set, but it doesn't check if the authorization headers are set.

This diff fixes that by setting the fetchPolicy of these components to cache-only, since the AddressWatcher component ensures that the query will be fetched correctly after the wallet is loaded.

This also reverts commit bb541f1cd26d6e3f6f76c2c65e2f0e341931c27b and 0b61d265f55b21d63755246950950790da2ff53a, which were hotfixes for the issue.

Test Plan

mikej-digix commented 5 years ago

iteration: 1 status: PASSED environment: LOCAL

Test Appoarch: regression testing

==============================================================================
Dao-Test-Automation.Src.Suite.Endtoend.DaoOneMilestoneETest :: This suite w...
==============================================================================
Proposer Has Successfully Created A Proposal                          
ProjectName:1559196250
| PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Endorsed Newly Created Proposal            | PASS |
------------------------------------------------------------------------------
Participant Has Successfully Logged In To DigixDao                    | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Finalized Proposal                          | PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Approved Created Proposal                  | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Claimed Approved Proposal                   28.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Voted Yes On Proposal                      | PASS |
------------------------------------------------------------------------------
Participant Has Successfully Voted No On Proposal                     | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Voted Yes On Proposal                       | PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Revealed Vote To Proposal                  94.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Participant Has Not Successfully Voted Using Modified Salt File       | PASS |
------------------------------------------------------------------------------
Participant Has Successfully Revealed Vote To Proposal                | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Revealed Vote To Proposal                   | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Claimed Vote Result                         31.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Claimed First Milestone Funding             | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Completed First Milestone                   | PASS |
------------------------------------------------------------------------------
Participant Has Successfully Voted No For First Milestone             | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Voted Yes For First Milestone               | PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Voted Yes For First Milestone              | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Revealed Vote For First Milestone           112.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Participant Has Successfully Revealed Vote For First Milestone        | PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Revealed Vote For First Milestone          | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Claimed Vote Result On Reviewed First Mi... 64.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Endtoend.DaoOneMilestoneETest :: Thi... | PASS |
23 critical tests, 23 passed, 0 failed
23 tests total, 23 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoSetUsernameEmailTest :: This su...
==============================================================================
Participant Has Successfully Validated Stats On Profile View Page     | PASS |
------------------------------------------------------------------------------
Participant Has Successfully Sets Username                            | PASS |
------------------------------------------------------------------------------
Participant Has Successfully Sets Email                               | PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Validated Stats On Profile View Page       | PASS |
------------------------------------------------------------------------------
Moderator Has Not Sucecssfullly Set Username Due to Username Alrea... | PASS |
------------------------------------------------------------------------------
Moderator Has Not Sucecssfullly Set Email Due to Username Already ... | PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoSetUsernameEmailTest :... | PASS |
6 critical tests, 6 passed, 0 failed
6 tests total, 6 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Endtoend.ForumAdminETest :: This suite will t...
==============================================================================
Proposer Has Successfully Created A Proposal                          
ProjectName:1559195472
| PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Posted Multiple ThreadsA And Sorted To O... | PASS |
------------------------------------------------------------------------------
ForumAdmin Has Successfully Remove A Comment                          | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Viewed Removed Commment                     | PASS |
------------------------------------------------------------------------------
ForumAdmin Has Successfully Restore A Comment                         | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Viewed Restored Comment                     | PASS |
------------------------------------------------------------------------------
ForumAdmin Has Successfully Banned A User For Commenting              | PASS |
------------------------------------------------------------------------------
Proposer Has Not Successfully Posted A Comment Due to Banned          | PASS |
------------------------------------------------------------------------------
ForumAdming Has Successfully UnBanned A User For Commenting           | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Posted A New Comment                        | PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Endtoend.ForumAdminETest :: This sui... | PASS |
10 critical tests, 10 passed, 0 failed
10 tests total, 10 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoLikeModuleTest :: This suite wi...
==============================================================================
Proposer Has Successfully Created A Proposal                          
ProjectName:1559195695
| PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Liked A Proposal On Dashboard Page          | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully UnLiked A Proposal On Dashboard Page        | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Liked A Proposal On Proposal View Page      | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully UnLiked A Proposal On Proposal View Page    | PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoLikeModuleTest :: This... | PASS |
5 critical tests, 5 passed, 0 failed
5 tests total, 5 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoCommentModuleTest :: This suite...
==============================================================================
Proposer Has Successfully Created A Proposal                          
ProjectName:1559195838
| PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Posted Multiple ThreadsA And Sorted To O... | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Posted Multiple Comments                    | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Posted Multiple Nested Comments             | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Showed All Comments                         | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Deleted A Comment                           | PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoCommentModuleTest :: T... | PASS |
6 critical tests, 6 passed, 0 failed
6 tests total, 6 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoAddDocsClaimFailedTest :: This ...
==============================================================================
Proposer Has Successfully Created A Proposal                          
ProjectName:1559195036
| PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Endorsed Newly Created Proposal            | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Finalized Proposal                          | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Added Additional Documents For Proposal     | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Claimed Failed Project                      30.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoAddDocsClaimFailedTest... | PASS |
5 critical tests, 5 passed, 0 failed
5 tests total, 5 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoAddDocsClaimFailedTest :: This ...
==============================================================================
Proposer Has Successfully Created A Proposal                          
ProjectName:1559195036
| PASS |
------------------------------------------------------------------------------
Moderator Has Successfully Endorsed Newly Created Proposal            | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Finalized Proposal                          | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Added Additional Documents For Proposal     | PASS |
------------------------------------------------------------------------------
Proposer Has Successfully Claimed Failed Project                      30.0 remaining seconds to start next step
| PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoAddDocsClaimFailedTest... | PASS |
5 critical tests, 5 passed, 0 failed
5 tests total, 5 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Integration.DaoCreateWalletRedeemBageTest :: ...
==============================================================================
User Has Successfully Created A New Wallet With Transferred Funds     | PASS |
------------------------------------------------------------------------------
User Has Successfully Participated To DigixDao EcoSystem              | PASS |
------------------------------------------------------------------------------
User Has Successfully Redeemed Badge                                  | PASS |
------------------------------------------------------------------------------
User Has Successfully Locked DGD on Wallet Page                       | PASS |
------------------------------------------------------------------------------
User Has Successfully Locked DGD on Header                            | PASS |
------------------------------------------------------------------------------
User Has Successfully Locked DGD on Moderator Card On Profile Page    | PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Integration.DaoCreateWalletRedeemBag... | PASS |
6 critical tests, 6 passed, 0 failed
6 tests total, 6 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoClaimRewardTest :: This suite w...
==============================================================================
User Has Successfully Claimed Rewards On Wallet Page                  | PASS |
------------------------------------------------------------------------------
Claimed Reward User Has Successfully Visited Wallet Page              | PASS |
------------------------------------------------------------------------------
User Has Successfully Viewed DGD,DGX, And Eth Usd Conversion          | PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoClaimRewardTest :: Thi... | PASS |
3 critical tests, 3 passed, 0 failed
3 tests total, 3 passed, 0 failed
==============================================================================
==============================================================================
Dao-Test-Automation.Src.Suite.Functional.DaoNoLimitFundingTest :: This suit...
==============================================================================
Founder Has Successfully Created A Proposal Without Funding Limit     
ProjectName:1559198279
| PASS |
------------------------------------------------------------------------------
Founder Has Successfully Edited A Proposal Without Funding Limit      
ProjectName:1559198336
| PASS |
------------------------------------------------------------------------------
Dao-Test-Automation.Src.Suite.Functional.DaoNoLimitFundingTest :: ... | PASS |
2 critical tests, 2 passed, 0 failed
2 tests total, 2 passed, 0 failed
==============================================================================