neos / contentrepository-development-collection

Work in Progress on the Event Sourced Content Repository as installable set of packages
4 stars 9 forks source link

Make content stream version available in Content Graph read model #194

Open bwaidelich opened 3 years ago

bwaidelich commented 3 years ago

Idea/motivation

Currently the "version" of the Content Graph read model can only implicitly be determined using the AppliedEventsLog. But this information just contains the "highest applied sequence number", i.e. spans all content streams.

If we kept track of the event version per content stream (i.e. the ES stream version) this would allow for a more resilient blocking mechanism and make it easier for 3rd parties to react on updates for a given content stream.

Implementation

The PHP API could be extended by

interface ContentGraphInterface {
    public function getContentStreamVersion(ContentStreamIdentifier $contentStreamIdentifier): int;
}

Note: we could also extend ContentSubgraphInterface by a method getVersion(): int but since the version is independent from the visibility constraints and dimension, I think it should be added to the content graph interface.

skurfuerst commented 3 years ago

:+1: - just a mini nitpick: IMHO this should return a ContentStreamVersion ValueObject, not an int ;)