front-end-monorepo: Daily count stats bug
Package app-project
Describe the bug
A clear and concise description of what the bug is.
Found while doing follow up testing for #2238. I was testing to make sure I didn’t introduce a regression and found a bug that is pre-existing on production. I’m wondering if this is a bug having to do with the localization happening in DailyClassificationsChartContainer here:
Anyway, I made a classification on Monday and the bar chart shows I have one on Sunday and Monday even though I didn’t actually on Sunday:
What it’s rendering:

The original store data is correct:

And in the response from the stats service:

So the culprit is likely the above noted function.
To Reproduce
Steps to reproduce the behavior:
- Go to https://fe-project.zooniverse.org/projects/blicksam/transcription-task-testing/classify/workflow/13898
- Make a classification (on a Monday in a US timezone maybe?)
- Check out the daily classifications bar chart
- There’s a count for Sunday and Monday.
Expected behavior
A clear and concise description of what you expected to happen.
Only counts render on the days a volunteer has made them. Note the data from the stats service is correct. This is just a rendering bug.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (20 by maintainers)
@goplayoutside3 this bug has regressed. See https://www.zooniverse.org/talk/17/3466158?comment=5709216
It was fixed, with tests, in #2359, but those tests were removed in #5210. The missing tests are the tests that check the day name and classification count for each bar of the chart.
I think the bug is this line here, which can return the wrong result for today when your local clock isn’t UTC. https://github.com/zooniverse/front-end-monorepo/blob/efe06db5a7d294043f3b354f9f9a8e5f050e90d6/packages/app-project/src/screens/ClassifyPage/components/YourStats/components/DailyClassificationsChart/DailyClassificationsChartContainer.js#L18
Eg. during the evening in Chicago, your local clock could be Wednesday but the UTC day would be Thursday. If the code updates Wednesday, when you press Done, it will actually increment yesterday’s count.