What type of issue is this?
Prerequisites
Description
IMHO the Thing.Actor property of the "current state" of a Thing should contain a reference to the Person that made the last change to that Thing.
Getting it from the *_audit tables does not seem to be the best way as it does not (always?) contain a row for the current state of the Thing. The join to the *_audit tables filtered on the fact that "ValidTo" (from the _audit table) should be infinity is therefore wrong. In any case for ParameterValueSetDao, but probably for other tables also.
I think we should join with the *_revision tables to get the correct Actor based on the current Revision in *Dao.ReadAsync.
The joins for isCachedDtoReadEnabledAndInstant = true and the BuildReadQuery should also be different. They now use the same function to get the JOIN statement (method BuildJoinForActorProperty)
We might also need to consider to add the Actor property to the *_cache JsonB data so the extra join to get the Actor from the _revision table is not necessary anymore.
What type of issue is this?
Prerequisites
Description
IMHO the Thing.Actor property of the "current state" of a Thing should contain a reference to the Person that made the last change to that Thing.
Getting it from the *_audit tables does not seem to be the best way as it does not (always?) contain a row for the current state of the Thing. The join to the *_audit tables filtered on the fact that "ValidTo" (from the _audit table) should be infinity is therefore wrong. In any case for ParameterValueSetDao, but probably for other tables also.
I think we should join with the *_revision tables to get the correct Actor based on the current Revision in *Dao.ReadAsync.
The joins for isCachedDtoReadEnabledAndInstant = true and the BuildReadQuery should also be different. They now use the same function to get the JOIN statement (method BuildJoinForActorProperty)
We might also need to consider to add the Actor property to the *_cache JsonB data so the extra join to get the Actor from the _revision table is not necessary anymore.