Page MenuHomePhabricator

API returns the wrong values for 'total' and 'count' of ratings
Closed, DeclinedPublic

Description

As reported on [[mw:Thread:Talk:Article feedback/I think I have encountered a bug?]], the averages for the article [[Remember December]] are wrong.

The data returned from API in the query given in the url above includes the following values:


"pageid": "28172104",
"revid": 442275047,
"ratings": [

{
  "ratingid": 1,
  "ratingdesc": "articlefeedback-field-trustworthy-label",
  "total": 4294967316,
  "count": 4294967300,
  "countall": 6
},
{
  "ratingid": 2,
  "ratingdesc": "articlefeedback-field-objective-label",
  "total": 4294967317,
  "count": 4294967300,
  "countall": 6
},
{
  "ratingid": 3,
  "ratingdesc": "articlefeedback-field-complete-label",
  "total": 4294967318,
  "count": 4294967300,
  "countall": 6
},
{
  "ratingid": 4,
  "ratingdesc": "articlefeedback-field-wellwritten-label",
  "total": 4294967319,
  "count": 4294967300,
  "countall": 6
}

],

The numbers for each 'total' and 'count' seems to be wrong.


Version: unspecified
Severity: major
Whiteboard: wikimedia[unmaintained]
URL: http://en.wikipedia.org/w/api.php?_=1312475393977&action=query&format=jsonfm&list=articlefeedback&afpageid=28172104&afanontoken=bnlRBcwVFvAHJdaoPJ1Ka1Wv9VNtAZ6X&afuserrating=1&maxage=0&smaxage=0

Details

Reference
bz30227

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:53 PM
bzimport added a project: ArticleFeedback.
bzimport set Reference to bz30227.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

As reported on [[mw:Thread:Talk:Article feedback/I think I have encountered a
bug?]]

The link above didn't work (is there a bug on bugzilla about this?), so I hope this will works:

https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Thread:Talk:Article_feedback/I_think_I_have_encountered_a_bug%3F

It looks to me like the total and count fields are trying to be negative (which shouldn't happen in the first place), and are wrapping around because they're unsigned fields in the database.

I've fixed all instances of wrapped-around (values above 4 billion) values in the article_feedback_revisions table; 162 revisions were affected. I also think I've found and fixed the race condition that caused these values to appear in the first place in r94404, but we won't really know whether that worked until I deploy that revision on Monday.

Marking as FIXED, at least for now, because the bug as described doesn't occur any more.

  • Bug 30021 has been marked as a duplicate of this bug. ***

adjwilley wrote:

There is a similar bug that is visible on http://en.wikipedia.org/wiki/Mormons

(In reply to comment #6)

There is a similar bug that is visible on http://en.wikipedia.org/wiki/Mormons

Indeed, it displays

  • Trustworthy: 130150527.4
  • Objective: 113025458.3
  • Complete: 119304650.5
  • Well-written: 3.8

Is the fix deployed yet?

For the record,
http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&list=articlefeedback&afpageid=18925&afanontoken=&afuserrating=0&maxage=0&smaxage=2592000

returns the following data for that page right now:

{
"query": {
"articlefeedback": [
{
"pageid": "18925",
"revid": 447998960,
"ratings": [
{
"ratingid": 1,
"ratingdesc": "articlefeedback-field-trustworthy-label",
"total": 4294967404,
"count": 33,
"countall": 55
},
{
"ratingid": 2,
"ratingdesc": "articlefeedback-field-objective-label",
"total": 4294967414,
"count": 38,
"countall": 60
},
{
"ratingid": 3,
"ratingdesc": "articlefeedback-field-complete-label",
"total": 4294967418,
"count": 36,
"countall": 59
},
{
"ratingid": 4,
"ratingdesc": "articlefeedback-field-wellwritten-label",
"total": 130,
"count": 34,
"countall": 59
}
],
"status": "current"
}
]
}

}

Current average ratings.

Trustworthy: 3.6 (92 ratings)
Objective: 3.0 (95 ratings)
Complete:2.9 (92 ratings)
Well-written: 3.3 (92 ratings)

Above API link gives:
{
"query": {

		"articlefeedback": [
			{
				"pageid": "18925",
				"revid": 452239879,
				"ratings": [
					{
						"ratingid": 1,
						"ratingdesc": "articlefeedback-field-trustworthy-label",
						"total": 25,
						"count": 7,
						"countall": 92
					},
					{
						"ratingid": 2,
						"ratingdesc": "articlefeedback-field-objective-label",
						"total": 18,
						"count": 6,
						"countall": 95
					},
					{
						"ratingid": 3,
						"ratingdesc": "articlefeedback-field-complete-label",
						"total": 20,
						"count": 7,
						"countall": 92
					},
					{
						"ratingid": 4,
						"ratingdesc": "articlefeedback-field-wellwritten-label",
						"total": 23,
						"count": 7,
						"countall": 92
					}
				],
				"status": "current"
			}
		]

}
}

Copying the bug report from[0]:

I noticed in [[Scott Tucker (racing driver)]] that the Objective rating for the article is currently pegged at 715827884.3 after 9 votes. How did someone get a vote in the millions in?

The API[2] currently returns the following on that page
{
"query": {
"articlefeedback": [
{
"pageid": "25986151",
"revid": 452916497,
"ratings": [
{

		"ratingid": 1,
		"ratingdesc": "articlefeedback-field-trustworthy-label",
		"total": 12,
		"count": 5,
		"countall": 9

},
{

		"ratingid": 2,
		"ratingdesc": "articlefeedback-field-objective-label",
		"total": 4294967306,
		"count": 6,
		"countall": 9

},
{

		"ratingid": 3,
		"ratingdesc": "articlefeedback-field-complete-label",
		"total": 7,
		"count": 6,
		"countall": 9

},
{

		"ratingid": 4,
		"ratingdesc": "articlefeedback-field-wellwritten-label",
		"total": 9,
		"count": 5,
		"countall": 8

}
],
"status": "current"
}
]
}
}

[1] https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Thread:Talk:Article_feedback/Bug%3F
[2] http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&list=articlefeedback&afpageid=25986151&afanontoken=&afuserrating=0&maxage=0&smaxage=2592000

(In reply to comment #9)

Copying the bug report from[0]:

I noticed in [[Scott Tucker (racing driver)]] that the Objective rating for the
article is currently pegged at 715827884.3 after 9 votes. How did someone get a
vote in the millions in?

Yeah, this is almost fixed, hopefully, but not quite. I deployed something that I think will help fix it, but I haven't cleaned up all the old corrupted rows yet.

Any update on the corrupted rows being fixed?

Roan: How did you clean up the corrupted rows? Did you recalculate the totals or just drop all the bogus rows? If you just dropped them, should be easy enough for someone to finish the job.

The extension homepage at [[mw:Extension:ArticleFeedback]] says
"This extension has been archived. This extension has not been maintained in some time, and no longer supports recent releases of MediaWiki.
The following other choices are still available: [[mw:Extension:ArticleFeedbackv5]]"

Furthermore, ArticleFeedback (version 4 or earlier) was removed from all Wikimedia wikis in https://gerrit.wikimedia.org/r/#/c/98074/

It is currently unlikely that there will be any further active development of ArticleFeedback (version 4 or earlier).
Closing this report as WONTFIX to reflect reality.
Please feel free to reopen this report in the future if anyone takes the responsibility for active development of ArticleFeedback (version 4 or earlier) again.

Thank you for reporting this bug and we are sorry it could not be fixed.