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

fix(cs/serialization): Improve precision in date serialization #344

Merged
merged 4 commits into from
Aug 9, 2024

Conversation

andrewmd5
Copy link
Contributor

  • Modify BebopWriter.WriteDate method to use a more precise algorithm
  • Introduce constants for ticks between epochs and date mask
  • Update date conversion to use milliseconds since Unix epoch
  • Apply bitmask to ensure consistent 64-bit representation

This change should resolve hash discrepancies caused by date fields when serializing and deserializing objects.

Testing:

  • Verified consistent hashing of original and round-tripped data
  • Ensured compatibility with existing implementations

- Modify `BebopWriter.WriteDate` method to use a more precise algorithm
- Introduce constants for ticks between epochs and date mask
- Update date conversion to use milliseconds since Unix epoch
- Apply bitmask to ensure consistent 64-bit representation

This change should resolve hash discrepancies caused by date fields when serializing and deserializing objects.

Testing:
- Verified consistent hashing of original and round-tripped data
- Ensured compatibility with existing implementations
…entations

This commit modifies the date deserialization process in Bebop to ensure
consistency with the other implementations and corrects a type mismatch
issue. This change complements the previous fix for date serialization,
providing a complete and correct solution for date handling across languages.

- Modify `BebopReader.ReadDate()` method to use a more precise algorithm
- Introduce constants for ticks between epochs and date mask
- Update date conversion to use milliseconds since Unix epoch
- Ensure UTC DateTime is always returned
- Fix type mismatch between ulong and long in date calculation
- Use unchecked conversion to handle potential overflow

This change resolves inconsistencies in date representation when
deserializing data.
@andrewmd5 andrewmd5 merged commit 1a78cd6 into master Aug 9, 2024
6 checks passed
@andrewmd5 andrewmd5 deleted the cs-date-fix branch August 9, 2024 05:03
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.

1 participant