Last modified: 2008-12-14 07:10:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14645, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12645 - File histories should be paged
File histories should be paged
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.12.x
All All
: High major (vote)
: ---
Assigned To: Aaron Schulz
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-15 21:09 UTC by Roan Kattouw
Modified: 2008-12-14 07:10 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2008-01-15 21:09:31 UTC
I've tried to introduce paging for file histories in the API, but found that it's not implemented in the UI either (it should). This seems to be because the code in File.php is very pager-unfriendly: file histories are gotten by calling File::nextHistoryLine() repeatedly, and there is no way to specify an offset at which to start. If that is possible, paging can be implemented.

Notice: the reason I think paging should be implemented is that vandals could upload thousands of different versions of an image, flooding the image history in both the UI and the API and potentially mounting a DoS attack (hence the high severity). I've limited the API to 500 file revisions as a temporary measure, and I suggest someone do the same with the UI.
Comment 1 Roan Kattouw 2008-01-18 19:01:09 UTC
News flash: I looked at the LocalFile::nextHistoryLine() and it turns out to do a DB query on every call. As that function is typically called in a loop, that means DB queries in loops (waits for Domas to kill someone).
Comment 2 Victor Vasiliev 2008-01-20 06:58:34 UTC
Introduced new method in r29966
Comment 3 Aaron Schulz 2008-12-06 01:36:32 UTC
(In reply to comment #1)
> News flash: I looked at the LocalFile::nextHistoryLine() and it turns out to do
> a DB query on every call. As that function is typically called in a loop, that
> means DB queries in loops (waits for Domas to kill someone).
> 

ImagePage.php doesn't use that though. It does the old versions in one query and iterates using it's own wrapper so to speak. Does anything use nextHistoryLine() though?
Comment 4 Aaron Schulz 2008-12-14 07:10:56 UTC
Done in r44564 using getHistory()

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links