Page MenuHomePhabricator

Link generates incorrect time fields
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • When I click the 'Permanent link' button at the top right of the chart/graph in Wikimedia Statistics to copy a link to that page,

What happens?:

it will give a date range that is too broad (2 months instead of one by adding an extra month on to the end) leading to:

  • displaying a different month other than the one displayed at time of copying

or

  • error message that says 'loading' but it never loads

or

  • no noticeable error for some charts that are of a long enough time series (though no noticeable benefit either)

What should have happened instead?:

  • it should give a date range in the link that is exactly for the month displayed

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Extra month added at end
https://stats.wikimedia.org/#/en.wikinews.org/reading/total-page-views/normal|bar|2020-04-01~2026-11-01|agent~user|monthly
should be
https://stats.wikimedia.org/#/en.wikinews.org/reading/total-page-views/normal|bar|2020-04-01~2026-10-01|agent~user|monthly

Extra month at end but displays a month early (August instead of September)
https://stats.wikimedia.org/#/en.wikinews.org/reading/page-views-by-country/normal|table|2026-09-01~2026-11-01|(access)~desktop*mobile-app*mobile-web|monthly
should be
https://stats.wikimedia.org/#/en.wikinews.org/reading/page-views-by-country/normal|table|2026-09-01~2026-10-01|(access)~desktop*mobile-app*mobile-web|monthly

Details

Event Timeline

Restricted Application added a subscriber: • Aklapper. · View Herald Transcript
Superb_Owl updated the task description. (Show Details)
Superb_Owl updated the task description. (Show Details)

Change #1354233 had a related patch set uploaded (by Shwetamishra; author: Shwetamishra):

[analytics/wikistats2@master] Fix permalink time range calculation

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

I investigated T440796, fixed the permalink date range, and submitted the patch for review: https://gerrit.wikimedia.org/r/c/analytics/wikistats2/+/1354233.

Milimetric subscribed.

I replied in the code review:

If I remember correctly, this is a little hack to account for differences in data availability. The data fetcher will automatically step back through available dates until it finds the latest month. And we kept running into edge cases if we used the same month so we padded it with a month. Not ideal, but I think it works. I wouldn't mess with it until we make bigger changes on wikistats.

Change #1354233 abandoned by Shwetamishra:

[analytics/wikistats2@master] Fix permalink time range calculation

Reason:

Phabricator task T440796 was declined; the maintainer noted the extra month is an intentional workaround for data availability edge cases.

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

I replied in the code review:

If I remember correctly, this is a little hack to account for differences in data availability. The data fetcher will automatically step back through available dates until it finds the latest month. And we kept running into edge cases if we used the same month so we padded it with a month. Not ideal, but I think it works. I wouldn't mess with it until we make bigger changes on wikistats.

The issue is that it does not go to the correct month that you were on when you copied the link, so most of these links need to be manually edited in order to go to the correct destination which is not intuitive and certainly frustrating