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

app-project: YourProjectStats counts either freezing or number going down #6661

Open
eatyourgreens opened this issue Feb 3, 2025 · 8 comments

Comments

@eatyourgreens
Copy link
Contributor

eatyourgreens commented Feb 3, 2025

See @mutabilitie's comments here:
https://www.zooniverse.org/talk/17/3531984?comment=5863673

Classification stats revalidate on focus, which means that they can appear to freeze, or even go down, if you click out of a tab then back again and the number stored in the browser is replaced with an outdated count from the stats API.

@eatyourgreens
Copy link
Contributor Author

This is a regression of the classification counts bug mentioned in this comment: #5081 (comment)

@goplayoutside3
Copy link
Contributor

@eatyourgreens are you able to replicate this bug?

The talk comment above is from January 25, and the same commentor was mentioned in #6588. The solution to #6588, PR #6589 was deployed on January 29.

This is a regression of the classification counts bug mentioned in this comment: #5081 (comment)

The code that produced this bug is completely replaced at this point.

In order for this Issue to be actionable, please elaborate on the bug, if it's reproducible.

@eatyourgreens
Copy link
Contributor Author

Yep, it came up again today, while the API was running slow earlier this afternoon: https://www.zooniverse.org/talk/17/3531984?comment=5877516

@eatyourgreens
Copy link
Contributor Author

Very easy to reproduce when the API is running slow. Clicking out of a tab then back in again will make a request to eras.zooniverse.org and replace the displayed counts with lower numbers from the stats API. Revalidation doesn't check whether the API response is stale with respect to the numbers shown in the browser.

@eatyourgreens
Copy link
Contributor Author

eatyourgreens commented Feb 3, 2025

The simplest fix might be to ignore the API response if it's lower than the counts currently displayed on the page.

Turning off revalidateOnFocus might help too.

@goplayoutside3
Copy link
Contributor

Thanks! That helps. It looks like #6589 made this bug more obvious specifically for revalidate on focus.

@goplayoutside3 goplayoutside3 changed the title Classification stats either freezing or going down app-project: YourProjectStats counts either freezing or number going down Feb 3, 2025
@eatyourgreens
Copy link
Contributor Author

I don’t think classification counts ever go down, so that’s one potential validation check that could be made for incoming values.

revalidateOnFocus is useful when you’ve got a number that is changing in the background, like workflow.completeness. I’m not sure if it’s useful for personal classification counts, which won’t be changing in the background while you classify.

@eatyourgreens
Copy link
Contributor Author

An update from Talk: sometimes the counters refresh on focus to show 0.

.. and yet another variation: sometimes when have the classify page open, go to a different tab and then return, both counters are at 0 (until you go to another tab again and then back to classify). This seems to imply that when you return the counters are refreshed - but that doesn't really make any sense. After all, how could the number of classifications possibly have changed while I was looking at a different tab?

https://www.zooniverse.org/talk/17/3531984?comment=5880453

I think the the frontend code maybe isn't handling response errors or timeouts properly.

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

No branches or pull requests

2 participants