Page MenuHomePhabricator

Special:CXStats for Last week is wrong for guwiki
Closed, ResolvedPublic

Event Timeline

Change 337875 had a related patch set uploaded (by Nikerabbit):
Make our date manipulation to handle timezones consistently

@dchan Can you please look at this some time? Thanks.

Change 337875 merged by jenkins-bot:
Make our date manipulation to handle timezones consistently

Hmm, I might have made the problem worse (unless we really have multiple week gaps in our data):

pasted_file (280×1 px, 39 KB)

Old code on the left, new code on the right.

There is some horizontal movement due to sun-mon vs. mon-sun that I fixed, but also other weird patterns. Should look more closely what is going.

Based on Santhosh' query there are no gaps in the data in the database.

This is what API returns:

{count: 157512, delta: 2663, date: "2017-01-01"}
{count: 157512, delta: 0, date: "2017-01-08"}
{count: 163292, delta: 2936, date: "2017-01-15"}
{count: 163292, delta: 0, date: "2017-01-22"}
{count: 165705, delta: 2413, date: "2017-01-29"}

This is what $x = ContentTranslation\Translation::getTrendByStatus( null, null, 'published', 'month', null ); returns:

[1482624000]=> 2016-12-25
  ["count"]=>    int(151915)
  ["delta"]=>    int(2296)
[1483228800]=> 2017-01-01
  ["count"]=>    int(157512)
  ["delta"]=>    int(2663)
[1484438400]=> 2017-01-15
  ["count"]=>    int(163292)
  ["delta"]=>    int(2936)
[1485648000]=> 2017-01-20
  ["count"]=>    int(165705)
  ["delta"]=>    int(2413)
[1486252800]=> 2017-02-05
  ["count"]=>    int(168055)
  ["delta"]=>    int(2350)

The above is before we call ApiQueryContentTranslationLanguageTrend::addMissingDates, which obviously adds the empty things for the missing weeks. So bug seems to be in getTrendByStatus.

Change 340933 had a related patch set uploaded (by nikerabbit):
[mediawiki/extensions/ContentTranslation] Use mode 3 for YEARWEEK

Change 340933 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation] Use mode 3 for YEARWEEK

The original problem has been solved, but there is a new bug about broken dashboard user stats at: