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
NaN in heart/unicorn/bookmark count in a post #208
Comments
Hey @flexdinesh, thanks for the heads up. We'll fix that bug soon! |
I believe this is actually a couple bugs. On the frontend we just don't properly handle errors, so the "value" of the error is the 500 message, aka NaN. On the backend we also have issues with the reaction counts getting out of order with repeated clicking. I think we could rate limit this somehow. Whoever takes this check with me about how you plan to do it. |
* Fix bad user_id error handling * Remove spam user from index and remove old path
@benhalpern Seems like on the frontend, adding a Ideally, the UI would update optimistically and just the request to the server is debounced so it only sends with the final value. |
My pull request implements optimistic rendering and addresses the visual aspect of the bug. On error, NaNs won't be shown to the user and instead gracefully reverts the state of the reaction I'm currently working on migrating the actions bar to preact but if this is enough of a priority I could work on implementing @nickyhajal 's suggestion. Any thoughts @benhalpern? |
BUG
Current Behavior
When I click heart/unicorn/bookmark repeatedly(laggy internet connection), I get NaN in the counts.
Expected Behavior
When I click heart/unicorn/bookmark repeatedly, number should increase and decrease by 1 alternately.
Additional Info (steps to replicate, device/browser, helpful links)
Probably this happens, when the user clicks the icon again before the async request returns for each click (can happen with slow internet).
Screenshots
The text was updated successfully, but these errors were encountered: