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

Contest entry loading icon shows on every entry when voting #4734

Open
cl8n opened this issue Jul 29, 2019 · 5 comments
Open

Contest entry loading icon shows on every entry when voting #4734

cl8n opened this issue Jul 29, 2019 · 5 comments

Comments

@cl8n
Copy link
Member

cl8n commented Jul 29, 2019

chrome_2019-07-28_17-52-42
this spinning loading icon shows on every entry except the one being voted for. the star turns a lighter color after the vote request finishes, so I feel like this loading icon doesn't need to exist at all

picture is taken right after clicking on the vote button

@nekodex
Copy link
Collaborator

nekodex commented Aug 7, 2019

The spinner definitely needs to still exist (probably just on the current vote being cast) - not everyone in the world has amazing internet, so feedback should be provided indicating that their vote has been cast properly.

@cl8n
Copy link
Member Author

cl8n commented Aug 7, 2019

the star changes color once the vote is cast, so there already is feedback. the loading icon would be a little more obvious though

@nekodex
Copy link
Collaborator

nekodex commented Aug 7, 2019

IIRC the star changes colour immediately on click and not after request completion - meaning if the request fails (i.e. internet cuts out, etc), then the user would be none the wiser and think their vote went through when it didn't...

@nekodex
Copy link
Collaborator

nekodex commented Aug 23, 2019

Just to add some background (originally posted in #4752):

When the page was first written, it was done in such a way that only one voting action could be performed at once (i.e. no async voting). That's why the spinner was made visible on all the entries at the same time - to give clear feedback to the user that you can't currently make another vote.

A proper fix for this involves more than just changing which spinners are displayed - it would need to update the voting system to be able to handle asynchronous voting (remembering to keep track of outgoing votes vs max number of votes for the current contest and rolling back votes when errors occur, etc), but that's more complicated which is why it wasn't done initially.

@nanaya
Copy link
Collaborator

nanaya commented Aug 23, 2019

Before I forgot about this again, the change should be more or less:

  • each component manages its own loading state
  • when adding vote, tell the top component to reduce one available vote (and revert on failure)
  • when removing vote, wait until the process is done before telling the top component to add one available vote

@peppy peppy removed the bug label Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants