Skip to content

Large Commit ID is persisted with different value than logged #855

@andreiamariei

Description

@andreiamariei

When using RANDOM CommitIdGenerator, Javers logs different Commit IDs than what's being actually persisted in the database.

The issue seems to be the conversion to double in CommitId.valueAsNumber().

Test (quickly written in spock):

def "large commit id test"() {
    expect:
        new CommitId(8804939115786087745, 0).valueAsNumber() == 8804939115786087745.00
}

results in:

Condition not satisfied:

new CommitId(8804939115786087745, 0).valueAsNumber() == 8804939115786087745.00
|                                    |               |
8804939115786087745.0                |               false
                                     8804939115786087424.00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions