Skip to content

[Bug]: Getting Actor data from Audit tables does not always return the correct data. #403

Description

@lxatstariongroup

What type of issue is this?

  • Bug report
  • Feature request

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the COMET Web Services
  • I have searched open and closed issues to ensure it has not already been reported

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions