You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this when I enabled java.time codecs on our Spring web application, as I'd like to save LocalDate as UTC rather than with the system default timezone.
I couldn't log into the app, and I chased this down to the MongoIndexedSessionRepository saving my session with an expiry date of midnight UTC this morning. This effectively meant there was no session, as they were created as expired.
I've now managed to get this down to a repro. It seems because there is a 'convertible pair' of Date and LocalDate, the conversion decides that it should convert Date to LocalDate, which is a lossy conversion.
I've tested with Spring Boot 2.7.12. My config looks like this:
Thanks for bringing this to our attention!
Right, useNativeDriverJavaTimeCodecs should prevent the Date to LocalDate conversion. We'll take care of that.
This commit prevents converters from being used as writing converter causing asymmetric write/read operations.
Closes#4390
Original pull request: #4392
This commit prevents converters from being used as writing converter causing asymmetric write/read operations.
Closes#4390
Original pull request: #4392
This commit prevents converters from being used as writing converter causing asymmetric write/read operations.
Closes#4390
Original pull request: #4392
I ran into this when I enabled java.time codecs on our Spring web application, as I'd like to save
LocalDate
as UTC rather than with the system default timezone.I couldn't log into the app, and I chased this down to the
MongoIndexedSessionRepository
saving my session with an expiry date of midnight UTC this morning. This effectively meant there was no session, as they were created as expired.I've now managed to get this down to a repro. It seems because there is a 'convertible pair' of
Date
andLocalDate
, the conversion decides that it should convertDate
toLocalDate
, which is a lossy conversion.I've tested with Spring Boot 2.7.12. My config looks like this:
And a simple test:
That fails like this:
The text was updated successfully, but these errors were encountered: