x-tools / xtools-legacy

Repository for the legacy XTools. See https://github.com/x-tools/xtools for the rewrite
GNU General Public License v3.0
42 stars 21 forks source link

editsummary reports last 150 major edit summary percentage as 99% instead of actual 100% #125

Closed DanHarkless closed 7 years ago

DanHarkless commented 7 years ago

I use {{Template:User edit summary}} on my user page, which links to https://tools.wmflabs.org/xtools/editsummary/index.php?name=Dan+Harkless&lang=en&wiki=wikipedia. It claims Edit summary for last 150 major edits: 99%, which is incorrect. My last 150 major edits all have a summary (as do the last 150 minor ones). You have to go back over 350 major edits to hit one I accidentally submitted without a summary. I took a look at https://github.com/x-tools/xtools/blob/master/public_html/editsummary/index.php, and it's certainly not clear to me why it would be calculating the percentage correctly for minor edits but not for major edits. At first I thought it was a float conversion / rounding problem, but playing around with some PHP test code, that appears not to be it. Maybe 1 or 2 dummy rows of some kind in the database with $row['rev_minor_edit'] == 0 which ought to be skipped?

DanHarkless commented 7 years ago

Not sure if someone updated the tool or if I just got to enough major edits beyond 150 (and 350...) to hide the miscalculation, but as of today, the tool is now correctly displaying 100% for my last 150 major edits. The last time I checked a few days ago, it was still incorrectly claiming 99% for the last 150. If the tool has been updated to correct the calculation (doesn't appear so, as the last commit was back on May 9th), please let me know so I can remove the warning from https://en.wikipedia.org/wiki/Template:User_edit_summary/doc that the tool may calculate the percentages incorrectly. Danke schoen.

Matthewrbowker commented 7 years ago

Okay, I will keep a special eye out for this bug as I convert the edit summary tool to the new codebase. I will close this task (because the problem has disappeared) and you are able to track the progress of the rewrite at https://phabricator.wikimedia.org/T170905 .