Page MenuHomePhabricator

Make sure RC injection jobs don't inject duplicate entries
Closed, ResolvedPublic

Description

We are migrating the old system to the new one, there is a non-zero chance that an RC entry might get added twice (for example, when we enable jobs but haven't disabled cron dispatching yet). We should make sure this doesn't happen.

Event Timeline

It does have some protection against duplication:

			if ( $this->rcDuplicateDetector
				&& $this->rcDuplicateDetector->getRecentChangeId( $rc ) !== null
			) {
				$this->logger->debug( __FUNCTION__ . ": skipping duplicate RC entry for " . $title->getFullText() );
			} else {
				$this->logger->debug( __FUNCTION__ . ": saving RC entry for " . $title->getFullText() );
				$rc->save();
			}

I think it's good. For now and doesn't need more work.

Ok, that sounds fine to me as well. And also, on reflection, duplicate entries during migration would probably be less of a problem than missing entries either way 🤔

True but users would see duplicate rows in their watchlist and makes them quite grumpy but yeah.

No reports about duplicate RC entries, as expected.