EditResultCache is meant to be an easy way for storing and retrieving
EditResults associated with revisions. It stores the data in the main
object stash which is supposed to be mostly persistent. In case the
main stash method fails, it falls back to trying to find the
EditResult in the ct_params field of revert change tags.
EditResultCache is to be used for delaying the execution of
RevertedTagUpdateJob until the edit is approved. The code for that
will be in the next commit in the relation chain.
This is a separate commit just for clarity.
Bug: T259103
Change-Id: I6c0c6556b6d98fcd131beb0957230ce7c7d268da
Updated the doc block to reflect the changes made in
I9279230303a01461039ae8a4641d9897ce194f73
Bug: T259014
Change-Id: I6aeec4ba75f1e5ac939ef526171d7268902f1f57
Serializable EditResult will be required to save it for later use by
RevertedTagUpdateJob.
Additionally I decided to save the serialization format version in
case we want to modify it in the future.
Bug: T259732
Change-Id: I0cddc9c0439c8a59b5f66cea9e7db5bb151cb53b
As the EditResult class changes a few things slightly and may be
a bit confusing for developers, I clarified it a bit in the
comments.
It would be probably useful to document this properly on mediawiki.org,
which I'll do once a few things with EditResult are sorted out.
Bug: T254074
Change-Id: Ic8d654ce2c10f079c5a3f417cb2dc0f6e5d7b5b2
EditResult is an immutable object created during a page update by
the PageUpdater using a builder object, the EditResultBuilder.
EditResult is a container for information on how the edit
interacted with the page and previous revisions. It also aims to
provide a standardized way of describing reverts and reverted
edits. It is as simple as possible, with no dependencies on the DB
or global variables. Most of the logic is encapsulated in the
builder.
PageUpdater::getEditResult() replaces the following methods:
* getOriginalRevisionId()
* getUndidRevisionId()
They are both available in the EditResult object.
PageUpdater::markAsRevert() replaces
PageUpdater::setUndidRevisionId()
Bug: T254074
Change-Id: Ie04c38043d9c295552e488109436ec1df20bb2ca