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

Date decoding strategy #82

Merged
merged 4 commits into from
Apr 21, 2024

Conversation

surajthomask
Copy link

Hi Joannis,

I have pushed couple of commits which can address the issue with timestamp to date conversion introduced in version 8.0.2.

A short description of the issue is that, pre-8.0.2, the date objects were being pushed into MongoDB as time interval from reference date (2000), but the 8.0.2 started to decode them as time interval from 1970.

If we can add a configuration to continue parsing the date fields as from time interval since 2000, we will be able to avoid a painful data migration on our existing production data.

Please have a look, and see if you have any other suggestions to address this in any other way.

Warm regards,
Suraj

@surajthomask
Copy link
Author

@Joannis I have added unit tests for the date decoding.
I have updated the default decoding strategy to reference date relative. This is because prior to 8.0.2, the dates were all relative to reference date. In 8.0.2, the decoding was changed to relative to unix epoch, but writing to DB is done as primitive. So I do not see any impact on any of the servers which adopted the version 8.0.2 on changing the default value.
The only flow where this strategy will be considered is for data that was inserted by pre-8.0.2 library and that will logically and correctly convert the value using reference date.
Please let me know your thoughts on this.

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