docbrown/spec/workers/articles
Jeremy Friesen 5ec47d99dc
Ensuring we don't track views of author or unpublished (#16143)
* Ensuring we don't track views of author or unpublished

Prior to this commit, I was surprised to learn that we:

1) Tracked an author's view of their article.
2) Tracked views of an unpublished article.

This came up from a Forem creator asking if they could reset the view
counter.  Or trigger the reset on publication.

I think a general business logic policy of don't track views for the
author and don't track views for unpublished articles is a reasonable
default.

Were we to pursue the clear views on publication, we'd need to consider
something that went from unpublished -> published -> unpublished ->
published.  Without a more explicit state machine, triggering a
busineiss logic behavior seems a bit unexpected.

In other words, I wrote an article.  There are 20 views when I realize
that I need to unpublished it.  I make the changes in the unpublished
state, and re-publish.  I'd assume that those 20 views would still be
"recorded" and counted towards my article's view counts.

* Adjusting condition structure

Prior to this commit, the `if` clause was rather far to the right.  This
helps make the if clause more pronounced.
2022-01-18 11:23:18 -05:00
..
bust_cache_worker_spec.rb Update bust_article to BustArticle (#11931) 2020-12-17 12:20:44 -05:00
bust_multiple_caches_worker_spec.rb Refactor cache purging (#12811) 2021-03-02 10:09:05 -05:00
enrich_image_attributes_worker_spec.rb Asynchronously detect image aspect ratios and apply proper attributes (#15170) 2021-10-26 13:39:25 -07:00
score_calc_worker_spec.rb Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
update_page_views_worker_spec.rb Ensuring we don't track views of author or unpublished (#16143) 2022-01-18 11:23:18 -05:00