Wikibase
MediaWiki Wikibase extension
|
Change propagation or dispatching is the process of updating Client sites with Repo changes / edits. This allows clients to update pages quickly after information on the repository changed.
NOTE:
Change propagation requires several components to work together.
On the Repo, we need:
On each Client, there needs to be:
The main work on the Repo side of things is done by the DispatchChangesJob, which is scheduled at the end of the RecentChangeSaveHookHandler.
Usage Tracking and Subscription Management
Usage tracking and subscription management are described in detail in md_docs_topics_usagetracking.
Change Buffer
The change buffer holds information about each change, stored in the wb_changes table, to be accessed by the repo wiki when processing the respective changes.
SiteLinkLookup
A SiteLinkLookup allows the client wiki to determine which local pages are “connected” to a given Item on the repository. Each client wiki can access the repo's sitelink information via a SiteLinkLookup service returned by ClientStore::getSiteLinkLookup(). This information is stored in the wb_items_per_site table in the repo's database.
ChangeHandler
The ChangeHandler::handleChanges() method gets called with a list of changes provided by a EntityChangeNotificationJobs. A ChangeRunCoalescer is then used to merge consecutive changes by the same user to the same entity, reducing the number of logical events to be processed on the client, and to be presented to the user.
ChangeHandler will then for each change determine the affected pages using the AffectedPagesFinder, which uses information from the wbc_entity_usage table (see md_docs_topics_usagetracking). It then uses a WikiPageUpdater to update the client wiki's state: rows are injected into the recentchanges database table, pages using the affected entity's data are re-parsed, and the web cache for these pages is purged.
WikiPageUpdater
The WikiPageUpdater class defines three methods for updating the client wikis state according to a given change on the repository: