Determine the relationship between log entries, dummy revisions, and domain events.
It seems like all logged changes should (eventually) also emit domain events. And so should all changes that create a revision. Some changes do both, or just one of the two, depending opn configuration and circumstances. This probably means that such changes should potentially emit two events, one focussed on the loggable action, and one focussed on the revision change.
Logged actions on the page entity:
- delete (but no dummy revision)
- undelete (but no dummy revision; also, revisions can be undeleted into existing pages, which may or may not affect the latest revision)
- create (optional; and important and undeletions also create pages)
- import (but imports via maintenance script are silent; also, revisions can be imported into existing pages, which may or may not affect the latest revision)
- move (but certain kinds of moves may be silent, e.g. namespace dupes; also may involve uverwrite/delete, and creation of redirects)
- page protection
- content model change
- history merge
- upload (will create pages if new file)
Considerations:
- events on the page entity wshould for ma chain of before/after states. That means that the change modeled by one event cannot overlap the change modeled by another.
- it would be nice if one could subscribe to a single stream of events to get all logged events (even on entities other than pages, like user accounts)
- it would be nice if one could subscribe to a single stream of events to get all changes to the current page content (but not other things, like protection or visibility changes)
- dummy revisions have to be saved before the log entry, because the log entry has to have the revision ID associated
- the associated revision ID of a log entry may or may not be a dummy revision (and may not be there at all)
- log entries are currently inserted atomically along with the actual state change. Is that a requirement? Or a problem? Could they be a consequence of the change, rather than a part of the change?