Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-591] Fix delay on loading stake pool list after switching SMASH server #2447

Conversation

thedanheller
Copy link
Member

@thedanheller thedanheller commented Mar 10, 2021

This PR fixes delay on loading stake pool list after switching the SMASH server.

JIRA ticket

Screenshots

image


Testing Checklist


Test Scenarios

Scenario 1 - Validate stake pool list updates according to the selected SMASH server

Given that I am on the "Stake pools" screen on "Settings"
When I switch the SMASH server
And check the Stake Pool list on "Staking center"
Then I can see the old list is no longer visible
And the new list is loading

Review Checklist

Basics

  • PR has been assigned and has appropriate labels (feature/bug/chore, release-x.x.x)
  • PR is updated to the most recent version of the target branch (and there are no conflicts)
  • PR has a good description that summarizes all changes
  • PR has default-sized Daedalus window screenshots or animated GIFs of important UI changes:
    • In English
    • In Japanese
  • CHANGELOG entry has been added to the top of the appropriate section (Features, Fixes, Chores) and is linked to the correct PR on GitHub
  • Automated tests: All acceptance and unit tests are passing (yarn test)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in development build (yarn dev)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in production build (yarn package / CI builds)
  • There are no flow errors or warnings (yarn flow:test)
  • There are no lint errors or warnings (yarn lint)
  • There are no prettier errors or warnings (yarn prettier:check)
  • There are no missing translations (running yarn manage:translations produces no changes)
  • Text changes are proofread and approved (Jane Wild / Amy Reeve)
  • Japanese text changes are proofread and approved (Junko Oda)
  • UI changes look good in all themes (Alexander Rukin)
  • Storybook works and no stories are broken (yarn storybook)
  • In case of dependency changes yarn.lock file is updated

Code Quality

  • Important parts of the code are properly commented and documented
  • Code is properly typed with flow
  • React components are split-up enough to avoid unnecessary re-renderings
  • Any code that only works in main process is neatly separated from components

Testing

  • New feature/change is covered by acceptance tests
  • New feature/change is manually tested and approved by QA team
  • All existing acceptance tests are still up-to-date
  • New feature/change is covered by Daedalus Testing scenario
  • All existing Daedalus Testing scenarios are still up-to-date

After Review

  • Merge the PR
  • Delete the source branch
  • Move the ticket to done column on the YouTrack board
  • Update Slack QA thread by marking it with a green checkmark

@gabriela-ponce
Copy link

@daniloprates This looks much better, but there is some odd behavior while loading the stake pools, these are the steps in which it reproduces:

1 - After switching the server, the count goes to 0 and the stake pools are loading.
2 - Then, after a while, some stake pools show up on the list. Check this video.
3 - Later, the list seems to reload again and shows 0 stake pools. Check this video.
4 - After a while, the list is displayed again with more items than before. Check this video.

The last two occurrences look wrong to me. Could this be improved?

@thedanheller
Copy link
Member Author

thedanheller commented Mar 10, 2021

@daniloprates This looks much better, but there is some odd behavior while loading the stake pools, these are the steps in which it reproduces:

1 - After switching the server, the count goes to 0 and the stake pools are loading.
2 - Then, after a while, some stake pools show up on the list. Check this video.
3 - Later, the list seems to reload again and shows 0 stake pools. Check this video.
4 - After a while, the list is displayed again with more items than before. Check this video.

The last two occurrences look wrong to me. Could this be improved?

@gabriela-ponce I couldn't reproduce it :/
I've pushed some loggings, so could you try to catch this error with the dev tools open?

Thanks

@tomislavhoracek
Copy link
Contributor

@daniloprates Can you define Testing Checklist, please 🙏

@miorsufianiohk
Copy link

Hi @daniloprates. On 17070, not sure why the stake pool keeps on refreshing and the animation never disappear. Is this expected behaviour? Please see video

@gabriela-ponce
Copy link

gabriela-ponce commented Mar 11, 2021

@daniloprates I tried to reproduce this issue again and this was the outcome:

  • Loading the stake pools for the first time (default server, no changes) worked as expected, no reloading occurred. Check the screenshot.
  • Then I switched the server to "None" and it reloaded a few times before completing the list. Here's a video of the first time it occurred. These are the logs that were displayed while 0 stake pools were shown. Here's a screenshot of the logs later while reloading and another video.
    So from my point of view, each time "Store result" has no data, the list reloads.

@thedanheller
Copy link
Member Author

  • video

@gabriela-ponce from these results I couldn't see anything wrong. When you change the SMASH option, the API fetches the new data and, at that time, the store result is "-". Did you notice anything strange, besides that?

@thedanheller
Copy link
Member Author

@daniloprates Can you define Testing Checklist, please 🙏

@tomislavhoracek the Scenario 1 @gabriela-ponce added to the Test Scenarios is really the only thing that needs to be tested. The reason for this issue to happen is that, right now, we don't reset the stakePoolsRequest, so after changing the SMASH server option, the old list remains there until the new API request is completed.

@gabriela-ponce
Copy link

@gabriela-ponce from these results I couldn't see anything wrong. When you change the SMASH option, the API fetches the new data and, at that time, the store result is "-". Did you notice anything strange, besides that?

Nothing besides that, but to clarify, the "store results: -" happens after the list started loading for the first time, so after switching the SMASH server and showing some items on the list. Hopefully, that's more clear.

@thedanheller
Copy link
Member Author

thedanheller commented Mar 11, 2021

@gabriela-ponce from these results I couldn't see anything wrong. When you change the SMASH option, the API fetches the new data and, at that time, the store result is "-". Did you notice anything strange, besides that?

Nothing besides that, but to clarify, the "store results: -" happens after the list started loading for the first time, so after switching the SMASH server and showing some items on the list. Hopefully, that's more clear.

@gabriela-ponce that's fine, as long as the results on screen are correct. There might be a delay in the logs, so they are only helpful to debug something wrong spot in the app itself. Thanks!

@miorsufianiohk
Copy link

@daniloprates sometimes I get this error, when I switch from moderated to unmoderated vice versa and quickly go to Stake pools view. It seems to be connected to the saving of the newly selected option. If I change the option quickly and go to Stake pools view, the app might not have enough time to save the newly selected option. See screenshot . Tested on 17082

@gabriela-ponce
Copy link

@daniloprates I can't reproduce the previous issue, so it looks good for me.
I'll wait for new changes regarding what @miorsufianiohk reported before approving 👍

@thedanheller
Copy link
Member Author

@daniloprates sometimes I get this error, when I switch from moderated to unmoderated vice versa and quickly go to Stake pools view. It seems to be connected to the saving of the newly selected option. If I change the option quickly and go to Stake pools view, the app might not have enough time to save the newly selected option. See screenshot . Tested on 17082

Hey @miorsufianiohk, thanks for the report. I've tried extensively to reproduce it, but it never happened to me. I've tried quickly changing the SMASH server multiple times, then going to the Stake Pools list. I've even created this function, which allows to quickly toggle between IOHK's and NONE options while in the Stake Pools list screen. You can use it by pasting it in the dev tools console:

const toggle = () => {
    const currentSmashServerUrl = daedalus.stores.staking.smashServerUrl;
    const smashServerUrl = (currentSmashServerUrl === 'direct')
        ? "https://smash.cardano-mainnet.iohk.io"
        : 'direct';
    daedalus.actions.staking.selectSmashServerUrl.trigger({ smashServerUrl });
};

Then pasting this multiple times:

toggle();

E.G.

image

If you are still getting this error, could you please record a video of it? Also, in which network?

@thedanheller thedanheller removed the WIP label Mar 11, 2021
@ManusMcCole ManusMcCole self-requested a review March 12, 2021 10:18
Copy link

@ManusMcCole ManusMcCole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work Danilo.LGTM. I couldnt reproduce the issue Mior had experienced after trying many times across all OS

@nikolaglumac
Copy link
Contributor

@gabriela-ponce please re-test this one 🙏

Copy link

@gabriela-ponce gabriela-ponce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't reproduce the issue. Works as expected 👍

@thedanheller
Copy link
Member Author

@tomislavhoracek could you give it a go?

Copy link
Contributor

@tomislavhoracek tomislavhoracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniloprates can you remove logs? We can proceed then

This reverts commit 5f7e436.
@tomislavhoracek tomislavhoracek self-requested a review March 12, 2021 19:57
Copy link
Contributor

@tomislavhoracek tomislavhoracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniloprates as always 💯

@nikolaglumac nikolaglumac merged commit 534694c into develop Mar 15, 2021
@iohk-bors iohk-bors bot deleted the fix/ddw-591-delay-on-loading-stake-pool-list-after-switching-smash-servers branch March 15, 2021 08:04
@nikolaglumac nikolaglumac added release-4.0.2-FC3 Daedalus Flight and removed ⏳release-vNext labels Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants