Page MenuHomePhabricator

[C-DIS] Verify and delete dead code in `InjectRCRecordsJob`
Open, Needs TriagePublic

Description

The private method \Wikibase\Client\Changes\InjectRCRecordsJob::getChange currently looks like this:

client/includes/Changes/InjectRCRecordsJob.php
	/**
	 * Returns the change that should be processed.
	 *
	 * EntityChange objects are loaded using a EntityChangeLookup.
	 *
	 * @return EntityChange|null the change to process (or none).
	 */
	private function getChange(): ?EntityChange {
		$params = $this->getParams();
		$change = $this->changeFactory->newFromFieldData( $params['change'] );

		// If the current change was composed of other child changes, restore the
		// child objects.
		$info = $change->getInfo();
		if ( isset( $info['change-ids'] ) && !isset( $info['changes'] ) ) {
			$children = $this->changeLookup->loadByChangeIds( $info['change-ids'] );
			$info['changes'] = $children;
			$change->setField( ChangeRow::INFO, $info );
		}

		return $change;
	}

I'm pretty sure that the part inside the if-condition does exactly nothing, because the changes/rows it tries to load from wb_changes have already been long since deleted in \Wikibase\Repo\ChangeModification\DispatchChangesJob::run, before this job was even scheduled.

Acceptance criteria:
So we should figure out:

  • is this condition in fact always false?
    • if so, delete that code
    • if it is sometimes true, figure out if that means that something is broken

Notes:

  • This is partially a follow-up to T351423

Event Timeline

ItamarWMDE renamed this task from Verify and delete dead code in `InjectRCRecordsJob` to [C-DIS] Verify and delete dead code in `InjectRCRecordsJob`.Nov 21 2023, 1:22 PM
ItamarWMDE moved this task from Incoming to [DOT] By Project on the wmde-wikidata-tech board.
ItamarWMDE added a project: Wikidata Dev Team.
karapayneWMDE subscribed.

removed from dev board until its can go through our prioritization pipeline