Page MenuHomePhabricator

NewImpact module: Page view data should be limited to when user made their first edit
Closed, ResolvedPublic

Description

The default time frame for page view data is 60 days, so if I edit article Foo today, then a few months from now, I should see 60 days worth of page view data for that article when I visit Special:Homepage or Special:Impact.

However, until we are past the threshold of 60 days, the page view data I see for article Foo should be limited to the date that I first edited. So, if I edit Foo on Thursday November 17, and:

  • today is Thursday November 17, I should see the clock icon as we do not yet have page view data to show of the current day.
  • today is Friday November 18, I should see page view data for that article for Nov 17 - Nov 18
  • today is Saturday November 19, I should se page view data for that article for Nov 17 - Nov 19
  • etc

Acceptance Criteria

  1. Should be able to ....
  2. ....
Completion checklist

Functionality

  • The patches have been code reviewed and merged
  • The task passes its acceptance criteria

Engineering

  • There are existing and passing unit/integration tests
  • Tests for every involved patch should pass
  • Coverage for every involved project should have improved or stayed the same

Design & QA

  • If the task is UX/Design related: it must be reviewed and approved by the UX/Design team
  • Must be reviewed and approved by Quality Assurance.

Documentation

  • Related and updated documentation done where necessary

Event Timeline

image.png (1×1 px, 155 KB)

@RHo @KStoller-WMF should the wording for "Views on articles you've edited" and "Views on articles you've edited" be modified to something like: "Views on articles after you edited"? As it is, it is kind of unclear what the user is looking at, IMHO.

I definitely think we need to change the "Views on articles you've edited" copy since it's repetitive and not very informative.
I asked about this in Figma, and Rita suggested we change it to more closely match the language we use currently:

People are viewing the articles you edited!

So I added that to the Positive Reinforcement copy doc so we would make that change eventually.

Do you think that's still not clear though? Should we consider something like:

People are viewing the articles you edited! Pageviews since you edited:

Change 858460 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] NewImpact: Only include page view data since user edited

https://gerrit.wikimedia.org/r/858460

Change 858461 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] NewImpact: Construct pageview URL conditionally on date of first edit

https://gerrit.wikimedia.org/r/858461

Change 858461 abandoned by Kosta Harlan:

[mediawiki/extensions/GrowthExperiments@master] NewImpact: Construct pageview URL conditionally on date of first edit

Reason:

Squashed into parent, will address unresolved comments in parent as well

https://gerrit.wikimedia.org/r/858461

Change 858460 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] NewImpact: Show 5 top viewed pages

https://gerrit.wikimedia.org/r/858460

For @kostajh review
Checked two scenarios in betalabs

(1) Edits made long time ago
The current date - Nov 29/2022 A user made edits on two articles on 10 May 2022 and on one article on Nov 13, 2021 and hasn't edited since.

Screen Shot 2022-11-29 at 7.47.53 PM.png (212×2 px, 149 KB)
Screen Shot 2022-11-29 at 7.54.10 PM.png (1×898 px, 170 KB)

The numbers won't match between the number of pageviews displayed in the Impact module and pageviews stats. end=latest doesn't include the current date.

(2) Edits that just made (copied from the comment https://phabricator.wikimedia.org/T322410#8426854)

the pageviews for user who just made an edit, will be displayed immediately

Screen Shot 2022-11-28 at 5.00.29 PM.png (1×980 px, 112 KB)

Another example - Time edited seconds ago immediately displays large number of pageviews (because it displays 60 days worth of data), but the sparkline doesn't reflect the actual fluctuations during that time interval.

Screen Shot 2022-11-29 at 8.15.02 PM.png (1×1 px, 168 KB)
Screen Shot 2022-11-29 at 8.21.24 PM.png (1×2 px, 1 MB)

The only case when delayed stats (the clock icon) will be displayed is when a user edits "local" article (i.e. Mavetuna articles in the screenshot below).

Screen Shot 2022-11-29 at 8.38.02 PM.png (1×1 px, 140 KB)

In the current production, the pageviews won't be immediately available

Screen Shot 2022-11-28 at 5.51.46 PM.png (846×860 px, 89 KB)

kostajh raised the priority of this task from Medium to High.

Moving back to ready for development per Elena's QA. Might make sense to do T323748: UserImpact: Adjust time zone correction for page view URLs alongside this one as well.

For @kostajh review
Checked two scenarios in betalabs

(1) Edits made long time ago
The current date - Nov 29/2022 A user made edits on two articles on 10 May 2022 and on one article on Nov 13, 2021 and hasn't edited since.

Screen Shot 2022-11-29 at 7.47.53 PM.png (212×2 px, 149 KB)
Screen Shot 2022-11-29 at 7.54.10 PM.png (1×898 px, 170 KB)

The numbers won't match between the number of pageviews displayed in the Impact module and pageviews stats. end=latest doesn't include the current date.

Depending on timezones, data updates, etc what you see on pageviews.wmcloud.org may differ subtly. I'll make a patch to set the end value to the last date we have pageview data for, for that particular article.

Change 862242 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] UserImpact: Set a specific end date for pageviews application URL

https://gerrit.wikimedia.org/r/862242

Change 862246 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] UserImpact: Adjust top viewed / recent edits without views logic

https://gerrit.wikimedia.org/r/862246

(2) Edits that just made (copied from the comment https://phabricator.wikimedia.org/T322410#8426854)

the pageviews for user who just made an edit, will be displayed immediately

Screen Shot 2022-11-28 at 5.00.29 PM.png (1×980 px, 112 KB)

Another example - Time edited seconds ago immediately displays large number of pageviews (because it displays 60 days worth of data), but the sparkline doesn't reflect the actual fluctuations during that time interval.

Screen Shot 2022-11-29 at 8.15.02 PM.png (1×1 px, 168 KB)
Screen Shot 2022-11-29 at 8.21.24 PM.png (1×2 px, 1 MB)

The only case when delayed stats (the clock icon) will be displayed is when a user edits "local" article (i.e. Mavetuna articles in the screenshot below).

Screen Shot 2022-11-29 at 8.38.02 PM.png (1×1 px, 140 KB)

In the current production, the pageviews won't be immediately available

Screen Shot 2022-11-28 at 5.51.46 PM.png (846×860 px, 89 KB)

Thank you, these scenarios should be covered by the patch in T323253#8431672

Change 862242 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] UserImpact: Set a specific end date for pageviews application URL

https://gerrit.wikimedia.org/r/862242

Change 862347 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@wmf/1.40.0-wmf.12] UserImpact: Set a specific end date for pageviews application URL

https://gerrit.wikimedia.org/r/862347

Change 862347 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.40.0-wmf.12] UserImpact: Set a specific end date for pageviews application URL

https://gerrit.wikimedia.org/r/862347

  • The next section titled Most viewed (since your last edit) shows the recent 60 days of pageviews, but the last edit happens more than 60 days for this case. A user might expect to see the stats fro 7 months not for 60 days.

Getting data for 7 months would be complicated (we could not use PageViewInfo). Maybe it would be worth to clarify the time range for the pageview stats with a similar language to what's used for edits?

Change 862828 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] User impact: Fix per-page pageview numbers

https://gerrit.wikimedia.org/r/862828

Change 862828 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] User impact: Fix per-page pageview numbers

https://gerrit.wikimedia.org/r/862828

Change 862354 had a related patch set uploaded (by Kosta Harlan; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@wmf/1.40.0-wmf.12] User impact: Fix per-page pageview numbers

https://gerrit.wikimedia.org/r/862354

Change 862354 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.40.0-wmf.12] User impact: Fix per-page pageview numbers

https://gerrit.wikimedia.org/r/862354

Mentioned in SAL (#wikimedia-operations) [2022-12-01T09:09:52Z] <kharlan@deploy1002> Started scap: Backport for [[gerrit:862354|User impact: Fix per-page pageview numbers (T323253)]]

Mentioned in SAL (#wikimedia-operations) [2022-12-01T09:11:08Z] <kharlan@deploy1002> kharlan and kharlan: Backport for [[gerrit:862354|User impact: Fix per-page pageview numbers (T323253)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2022-12-01T09:18:24Z] <kharlan@deploy1002> Finished scap: Backport for [[gerrit:862354|User impact: Fix per-page pageview numbers (T323253)]] (duration: 08m 31s)

Change 862246 abandoned by Kosta Harlan:

[mediawiki/extensions/GrowthExperiments@master] UserImpact: Adjust top viewed / recent edits without views logic

Reason:

I think this is no longer necessary (see also I1ea37343480821b5d2db9244f05da26ab8977b56)

https://gerrit.wikimedia.org/r/862246

Tested on testwiki wmf.14

  • a new user makes a first edit on one of suggested edits articles
  • returning to Homepage after the first edit, a user sees the following (an edit was made 15 min ago; Special:Contributions recorded it)
    Screen Shot 2022-12-13 at 5.49.56 PM.png (1×926 px, 111 KB)
  • The Console displays the error: TypeError: Cannot read properties of undefined (reading 'days')

@kostajh Logstash displays 26 errors in the last day on several wikis.

Etonkovidova updated the task description. (Show Details)

Checked after T324930 was done - testwiki wmf.14 shows new edits on NewImpact module correctly:

Screen Shot 2022-12-15 at 11.07.38 AM.png (1×942 px, 144 KB)