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

[release/6.0] Fix DateOnly and TimeOnly Formatting using interpolated strings #64460

Merged
merged 2 commits into from
Feb 7, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 28, 2022

Backport of #64398 to release/6.0

/cc @tarekgh

Customer Impact

Customer reported in #64292. These types are new in 6.0.

Anyone trying to format a DateOnly or TimeOnly object using an interpolated string with a wrong format specifier will lead to an infinite loop.
The actual cause was the implementation of the interface ISpanFormattable.TryFormat was assumed to return false in the case of formatting failure instead of throwing an exception.

Testing

I have added more tests for the cases concerned and passed the regressions and CI tests.

Risk

Very low as the change scoped to the failure case of the formatting to avoid the infinite loops and throw an exception instead.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Jan 28, 2022

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #64398 to release/6.0

/cc @tarekgh

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: tarekgh
Labels:

area-System.Runtime

Milestone: -

@tarekgh tarekgh added this to the 6.0.x milestone Jan 28, 2022
@tarekgh tarekgh added the Servicing-consider Issue for next servicing release review label Jan 28, 2022
@tarekgh
Copy link
Member

tarekgh commented Jan 28, 2022

CC @stephentoub @ericstj @danmoseley

@tarekgh
Copy link
Member

tarekgh commented Jan 28, 2022

The failures in the CI are tracked by the issue #64389.

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 1, 2022
@leecow leecow modified the milestones: 6.0.x, 6.0.3 Feb 1, 2022
@safern
Copy link
Member

safern commented Feb 7, 2022

Test failure is: #64389

@safern safern merged commit 9271e5a into release/6.0 Feb 7, 2022
@akoeplinger akoeplinger deleted the backport/pr-64398-to-release/6.0 branch February 10, 2022 17:48
@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.DateTime Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid format specifier on DateOnly in string interpolation leads to infinite loop instead of FormatException
5 participants