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

Number of views doesn't change #1765

Closed
sandordargo opened this issue Feb 8, 2019 · 15 comments
Closed

Number of views doesn't change #1765

sandordargo opened this issue Feb 8, 2019 · 15 comments
Labels
bug always open for contribution

Comments

@sandordargo
Copy link

Hi,

I found something strange for my number of views.

I have the same number of views (user: @sandordargo, views: 156) for my last three posts.

The last one is strange, it hasn't changed for like two days, while the number of reactions are going up and it was featured on twitter as well. I don't think that the number of reactions can go up without the number of views also going up.

Thanks for having a look.

Cheers

@Glennmen
Copy link
Contributor

Glennmen commented Feb 8, 2019

I have noticed the same, my post views has been 101 the entire day even though it has also been featured on twitter. I thought that views might not be updated live, unlike reactions, but was updated with a job once a day.
Curious about the reactions here if it is indeed a bug or intentionally.

@sandordargo
Copy link
Author

For me it's been 156 for days. Once a day makes sense, but having three posts with exactly the same number of views and for days... Must be a coincidence! :D We'll see!

@jessleenyc
Copy link
Contributor

Hm. Previously stats were updated each time someone interacts (reacts or comments) on a post but I believe we've started to pull numbers more frequently. I'll bring it up in our team meeting later.

@jessleenyc jessleenyc added the bug always open for contribution label Feb 12, 2019
@jessleenyc jessleenyc self-assigned this Feb 12, 2019
@jessleenyc
Copy link
Contributor

jessleenyc commented Feb 18, 2019

That is indeed the case. I think we should consider adding an update button next to each post so people can manually fetch the latest numbers. I'll create a separate issues for that.

I don't seem to be able to recreate your issue though. Have the numbers updated at all?

@jessleenyc jessleenyc removed their assignment Feb 26, 2019
@Glennmen
Copy link
Contributor

Glennmen commented Mar 4, 2019

Isn't this the part that causes the issue of article views not getting updated (when there are no new reactions)?
https://github.com/thepracticaldev/dev.to/blob/8b8dbd017253e05d0a00fc568f487fd602144dcc/app/labor/article_analytics_fetcher.rb#L47-L51

I see there is article.previous_positive_reactions_count to check if reactions have changed since last Analytics check, couldn't we solve this with a previous_analtyics_update_at datetime column that will trigger a new Analytics check if it has been more than 24 hours.

Having a manual Update button might be abused by people checking every 5 minutes.

@Glennmen
Copy link
Contributor

Glennmen commented Mar 5, 2019

@jessleenyc This is very strange, according to the logic in app/labor/article_analytics_fetcher.rb if the article has more reactions than the previous check it will fetch the views again for the article.

In the last ~4 days I gained 5-6 reactions for my last article but my views stayed at 711. It seems to stop updating at some point, there has to be something we are overlooking because according to the logic my views should have been updated.

@jessleenyc
Copy link
Contributor

Hey all, this should be fixed now!

@sandordargo
Copy link
Author

Thanks!

@Glennmen
Copy link
Contributor

@jessleenyc Will it also update/fix old articles? None of my article views seem to have been updated.

@jessleenyc jessleenyc reopened this Mar 19, 2019
@jessleenyc
Copy link
Contributor

Looks like it didn't update old articles. We'll run a script to fix that soon - will keep this issue open until then!

@Glennmen
Copy link
Contributor

@jessleenyc What PR fixed it for new articles? I think I missed it.

@jessleenyc
Copy link
Contributor

@Glennmen i believe it was this one: #1985

@jessleenyc
Copy link
Contributor

@Glennmen how do things look now?

@Glennmen
Copy link
Contributor

@jessleenyc Hard to say honestly, I don't see any difference compared to what I can remember from earlier or yesterday.

@jessleenyc
Copy link
Contributor

Hmm... well, we ran the script to update older article analytics. It's possible that the numbers haven't changed too much since the article is past its initial burst of engagement?

I'm going to close this issue for now but if you notice out of sync numbers again, definitely feel free to open a new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug always open for contribution
Projects
None yet
Development

No branches or pull requests

3 participants