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 @QueryValue of LocalDateTime type for 3.10.x #9970

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

rlconst
Copy link

@rlconst rlconst commented Oct 12, 2023

Fix for #9969 with test case

@CLAassistant
Copy link

CLAassistant commented Oct 12, 2023

CLA assistant check
All committers have signed the CLA.

@rlconst rlconst changed the title 3.10.x Fix @QueryValue of LocalDateTime type for 3.10.x Oct 12, 2023
@sdelamo sdelamo self-assigned this Oct 12, 2023
@rlconst
Copy link
Author

rlconst commented Oct 12, 2023

@sdelamo I tried to backport code from 4.x but it's really painfull because of Java 8 requirement

@rlconst rlconst force-pushed the 3.10.x branch 2 times, most recently from dc9c4ad to dae72a7 Compare October 12, 2023 09:20
@rlconst
Copy link
Author

rlconst commented Oct 12, 2023

Removed irrelevan code formatting

try {
DateTimeFormatter formatter = resolveFormatter(context);
// Treat missing zone as UTC
return Optional.of(formatter.format(object.atOffset(ZoneOffset.UTC)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ZoneOffset.systemDefault?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im against any implicit time zone at all, be it UTC or systemDefault. Why does this converter need to support RFC 1123? RFC 1123 makes no sense for LDT, we should not support it just like the JDK doesnt support it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dstepanov because systemDefault offset on client and server could be different

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yawkat I tried to minimize changes without changing the current semantic, especialy it was properly handled in 4.x

@sdelamo
Copy link
Contributor

sdelamo commented Oct 26, 2023

I added a test to the TCK. However, I don't reproduce the issue #10027

@rlconst
Copy link
Author

rlconst commented Oct 27, 2023

@sdelamo what the difference between TCK and DateTimeConversionSpec? Because if I rollback changes in converter, DateTimeConversionSpec reproducibly fails

@yawkat
Copy link
Member

yawkat commented Oct 27, 2023

ok, ive looked at the code some more. the reason why it works on 4 but not 3 is that we changed away from using RFC 1123 datetime by default, to ISO 8601 timestamps.

I am against fixing this by adding a timezone out of thin air. However I think an alternative solution is possible and I will update this PR.

@sdelamo
Copy link
Contributor

sdelamo commented Oct 29, 2023

do the changes done by @yawkat in this PR satisfy your needs @rlconst ?

@rlconst
Copy link
Author

rlconst commented Oct 31, 2023

@sdelamo sure. @yawkat thank you

@sdelamo sdelamo merged commit 9e20f4f into micronaut-projects:3.10.x Nov 1, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants