Page MenuHomePhabricator

Cannot send thanks for revision 1
Open, Needs TriagePublic

Description

ApiCoreThank::getRevisionFromId has the following code:

$revision = $this->revisionStore->getRevisionById( $revId );
// Revision ID 1 means an invalid argument was passed in.
if ( !$revision || $revision->getId() === 1 ) {
	$this->dieWithError( 'thanks-error-invalidrevision', 'invalidrevision' );
}

This is dubious to say the least. Thanking for revision 1 may not happen in the real world, but it can be quite common in tests, where we start with a fresh database.

This code was introduced in r125940 in 2014. Two years later, there has been a short conversation about this limitation, but nothing was done to address it.