User:Addshore/Diagrams/Sequence/Wikidata existing item edit via wbeditentity

From Wikitech
Jump to navigation Jump to search

Compatible with:

title Wikidata.org existing item edit via wbeditentity

participant API Client
participant MediaWiki
participant Wikibase [wbeditentity module]
participant Wikibase [EntitySavingHelper]
participant Wikibase [entity storage]
participant EditFilters [AbuseFilter]
participant Wikibase [EventDispatcher]

API Client->MediaWiki:Request with\nnew entity
activate MediaWiki
note over MediaWiki:Action API
MediaWiki->Wikibase [wbeditentity module]:Request with\nnew entity
activate Wikibase [wbeditentity module]
Wikibase [wbeditentity module]->Wikibase [entity storage]:Does this entity exist?
Wikibase [entity storage]->MediaWiki:Get details of this page? (ish)
note over Wikibase [entity storage]:Complexity hidden here
MediaWiki-->Wikibase [entity storage]:Page details
Wikibase [entity storage]-->Wikibase [wbeditentity module]:Entity if it exists\nRevision ID if it exists
Wikibase [wbeditentity module]->MediaWiki:Does the user have\nthe right permissions?
note over MediaWiki:Various things checked:\n - Can the user create this?\n - Can the user edit this?\n - Is the user blocked?
MediaWiki-->Wikibase [wbeditentity module]:Yes/No?
note over Wikibase [wbeditentity module]:Conditional early end
note over Wikibase [wbeditentity module]:- API module makes changes\nto the Entity loaded in memory\n- Summary generated based\non changes
Wikibase [wbeditentity module]->Wikibase [EntitySavingHelper]:EntitySavingHelper::attemptSaveEntity
note over Wikibase [EntitySavingHelper]:EntitySavingHelper is an API helper\n\n- Formating of summary\n- Setting of bot edit flag\n- Using baserevid from API\n...
Wikibase [EntitySavingHelper]->Wikibase [entity storage]:EditEntityHandler::attemptSave
note over Wikibase [entity storage]:- Check readonly DB\n- Check readonly entity type
Wikibase [entity storage]->MediaWiki:Check:\n - Edit permissions\n - Rate limits
MediaWiki-->Wikibase [entity storage]:Edit can proceed?
Wikibase [entity storage]->MediaWiki:Get latest page rev
MediaWiki-->Wikibase [entity storage]:Latest page rev
note over Wikibase [entity storage]:Edit conflict resolution
Wikibase [entity storage]->EditFilters [AbuseFilter]:Edit filters (AF)
EditFilters [AbuseFilter]-->Wikibase [entity storage]:Filters passed?
Wikibase [entity storage]->MediaWiki:Update watchlist if needed?
MediaWiki-->Wikibase [entity storage]:
note over Wikibase [entity storage]:Go from Entity to EntityContent
Wikibase [entity storage]->MediaWiki:Get page for EntityContent
MediaWiki-->Wikibase [entity storage]:Page
note over Wikibase [entity storage]:Edit conflict check
Wikibase [entity storage]->MediaWiki:Set page content\nSet patrol Status\nPersist Revision
MediaWiki-->Wikibase [entity storage]:New Revision
Wikibase [entity storage]->Wikibase [EventDispatcher]:entityUpdated (with revision)
Wikibase [EventDispatcher]-->Wikibase [entity storage]:
Wikibase [entity storage]-->Wikibase [wbeditentity module]:Save attempt success
Wikibase [wbeditentity module]-->MediaWiki:Request done\nresponse
deactivate Wikibase [wbeditentity module]
MediaWiki->API Client:Request done\nresponse
deactivate MediaWiki