Skip to content

findLastChangeRevision doesn't return last revision if two revisions with exactly the same timestamp exist #3579

@flauschtrud

Description

@flauschtrud

While running automated tests I ran into an issue with RevisionRepository.findLastChangeRevision.

If two revisions with exactly the same timestamp exist findLastChangeRevision does not necessarily return the revision with the highest revision number (which is what I would expect).

If my revinfo table has the following content findLastChangeRevision for the associated audited entity actually returns the revision with id 1 and not the one with id 2.

id,timestamp
1,2024-08-13 08:49:48.501000
2,2024-08-13 08:49:48.501000

In the implementation the revisions are ordered based on revisionProperty("timestamp") and the ID is not taken into account.

I am aware that this is an edge case and that it's way more likely to run into it in artificial scenarios but it's also not impossible to cause issues for production code.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions