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

CSHARP-975 fix: add check timestamp that cassandra gives if less then… #567

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

okanlodos
Copy link

this is for https://datastax-oss.atlassian.net/browse/CSHARP-975.

i added the min value as long because DateTimeOffset.ToUnixTimeMilliseconds() is not available in .net=4.5.2

@joao-r-reis
Copy link
Collaborator

joao-r-reis commented Nov 3, 2022

Hi, thanks for the issue report and the PR! It's still not clear to me what the best solution for this problem is so I'll keep investigating this.

I don't think the solution implemented in this PR is good enough because it basically modifies the data that is being read so the user will not actually be able to read the correct data from the database.

Since the type itself does not support the values that are being read from the database it seems to me that we have 2 options:

  1. Introduce a breaking change and change the default C# type that is associated with this C* type
  2. Introduce a custom serializer that users can use if they run into this issue (and potentially set this as the default in the next major version of the driver, whenever that happens)

I'm going to discard option 1 because this issue is very very rare so I can't justify forcing all users to change their application code for something that doesn't affect the vast majority of the userbase. For context, this is the first report of this issue and the driver has been around for a long time.

I'll try to get something together for option 2 to see if it is a good solution for this.

@okanlodos
Copy link
Author

okanlodos commented Nov 27, 2022

i guess, the best way to fix it is fix the datetime lib in java :D
even if we fix it, it won't work old incorrect data.

we are using csharpdriver with json select, and then deserialize to entity object with external json lib(newtonsoft etc.).
therefore we prevented that DateTimeSerialization throws exception by not using.
maybe, new serializer that handle this issue would be good.

if i have time, i am gonna look at what i can do better on this problem than 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.

2 participants