Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Vote banner doesn't update #1097

Closed
zillionn opened this issue Feb 24, 2019 · 9 comments
Closed

Vote banner doesn't update #1097

zillionn opened this issue Feb 24, 2019 · 9 comments
Labels
Type: Bug The issue relates to broken or incorrect behaviour.
Milestone

Comments

@zillionn
Copy link
Contributor

screenshot 2019-02-24 at 09 47 45

@ghost
Copy link

ghost commented Feb 24, 2019

@zillionn Thanks for opening this issue, a maintainer will get back to you shortly!

@ghost
Copy link

ghost commented Feb 24, 2019

@alexbarnsley @j-a-m-l @luciorubeens - please review this in the next few days. Be sure to explicitly select labels so I know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

@ghost ghost added the Status: Needs Review The issue or pull request needs a review by a developer of the team. label Feb 24, 2019
@dated
Copy link
Contributor

dated commented Feb 24, 2019

I can probably add this to #1027

@dated
Copy link
Contributor

dated commented Mar 8, 2019

The problem I see here is that the delegate list gets updated only on profile and network change. The naive approach would be to fetch the voted delegate through the API instead of the store, but I'd rather see a proper synchronization of the delegates.

@j-a-m-l
Copy link
Contributor

j-a-m-l commented Mar 8, 2019

@dated I've though about this issue too:

  • Delegates data should be accessed through the store.
  • Delegate data should be requested on the Synchronizer only to avoid duplicating code.
  • The synchronization is disabled to avoid making lots of requests just checking all the delegates.

My proposal would be enabling the synchronization again, but it should be done better:

  • On delegates page:
    • Synchronize with focus and check the current page only.
    • Try to infer the position (and page) of the current voted delegate and fetch it in case is not on the current page.
  • During the entire session:
    • Fetch the non-visible pages of delegates with a low frequency (every 5-15 minutes) to collect their names.
  • When a new transaction is received that registered a delegate, fetch the last page.

Apart from that, we may need adding a new endpoint to core to get only addresses and usernames (more than 100 in 1 request) to avoid requesting 10 pages just to know the usernames.

@j-a-m-l j-a-m-l added Type: Bug The issue relates to broken or incorrect behaviour. and removed Status: Needs Review The issue or pull request needs a review by a developer of the team. labels Mar 8, 2019
@zillionn
Copy link
Contributor Author

zillionn commented Mar 8, 2019

Btw the delegates list is correct, the banner Rank: 44 is wrong.

@dated
Copy link
Contributor

dated commented Mar 8, 2019

Yea, the delegates get fetched from the API, the voted delegate is looked up in the store which holds outdated data.

@faustbrian
Copy link
Contributor

Closing this as it will be soon resolved in v3.

@ghost
Copy link

ghost commented Aug 10, 2020

This issue has been closed. If you wish to re-open it please provide additional information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug The issue relates to broken or incorrect behaviour.
Projects
None yet
Development

No branches or pull requests

4 participants