Hits on unrevealed or hidden works freak work creators out

Description

Either:

  1. Post a work to an unrevealed collection

  2. Have someone other than the creator go to the URL for the work (unless they're an admin, they'll just see a message about the work being unrevealed, not the work)

Or:

  1. Post a work

  2. Log in as an admin and hide the work

  3. Have another admin go to the URL for the work (they'll be able to see the work)

What happens

A hit is registered and the creator contacts Support to ask how this could be happening.

What should happen

If the work is unrevealed or hidden, hits should not increase the hit count.

Testing

It’s probably a good idea to also check that hits to works that are revealed or not hidden actually increase the hit count.

Activity

Show:
Sarken
November 12, 2019, 8:54 AM
Edited

Posted a work to an unrevealed collection: https://test.archiveofourown.org/works/1070875

Visited it logged out

Visited it as an admin

Also, as long as I was logged in as an admin, I hid a work that had 5 hits: https://test.archiveofourown.org/works/1070818 (it should go up to 6 or 7 in a bit due to the viewing and hiding, and then I’ll check that the hit count doesn’t increase more)

Now we wait! It is 03:54 for me.

ETA 04:35: I forgot that I need not wait for the blurb to update! The hits in the meta (as opposed to the blurb) update basically instantly. And I can confirm that 1070875 stayed at 0 and 1070818 went up to 6 but didn’t go any higher even when using 2 different IPs (to make sure hits weren’t being disregarded due to that check).

Hits on regular works went up normally. I tested that with https://test.archiveofourown.org/works/1070781, which had 0 hits and now has 2 (one logged out on my phone, one logged in as admin).

All looks good!

 

redsummernight
November 13, 2019, 6:01 AM

Notes for testing:

  • Hit counts on the work meta are from Redis, they should update immediately. The scheduled task to move hits into the database doesn't matter here.

  • Use your home internet and your phone (on LTE) for 2 visitor IPs.

Sarken
November 15, 2019, 10:31 AM

I wanted to check that hits didn’t increase if you went to the first chapter as opposed to the work. It looked good, too!

Hidden work, chapter 1: https://test.archiveofourown.org/works/1070896/chapters/2140474 - Visited on my phone as admin and then on my computer as sarken, no increase in hits either time

Unrevealed work, chapter 1: https://test.archiveofourown.org/works/1070899/chapters/2140480 - Visited on my phone as admin and then on my computer as the challenge mod (sarken), no increase in hits either time

 

redsummernight
November 18, 2019, 2:01 AM

McBangle (unrevealed work):

I visited https://test.archiveofourown.org/works/1070875 as a challenge mod - hits are still 0. I don't have admin access on testing to test the non-admin half, though.

redsummernight
November 18, 2019, 2:23 AM

Looks good.

DeployedToBeta

Assignee

enigel lj

Reporter

Sarken

Roadmap

Works

Priority

Low

Affects versions

Fix versions

Components

BackEnd

Difficulty

Easy

Required Access Level

Admin

Milestone

Internal 0.9
Configure