Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#1252 Object to number strategy fix #1280

Conversation

madhavjha-git
Copy link
Contributor

@madhavjha-git madhavjha-git commented Mar 19, 2023

By default GSON maps object to number in double format. Changed this default behavior by changing strategy to ToNumberPolicy.LONG_OR_DOUBLE. This will enable GSON to map objects to number properly. See #1252 for example.

@bartoszwalacik
Copy link
Member

@madhavjha-git is this solution backward compatible? What happens if a new version on Javers deserializes data persisted by the previous versions?

@madhavjha-git
Copy link
Contributor Author

@bartoszwalacik Yes . This issue only happens during deserialization. I saved data using previous version and I see data was saved properly in jv_snapshots.

"state": {
"data": {
"$numberLong": "99999999999"
},
"type": "number"
},

Only after calling findShadows we get

    {
        "type": "number",
        "data": 9.9999999999E10
    }

But after this objectToNumberStrategy change, it works fine.

@bartoszwalacik
Copy link
Member

@bartoszwalacik
Copy link
Member

thanks @madhavjha-git , I will release it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants