Skip to content

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

Merged
safern merged 2 commits into
release/6.0from
backport/pr-64398-to-release/6.0
Feb 7, 2022
Merged

[release/6.0] Fix DateOnly and TimeOnly Formatting using interpolated strings#64460
safern merged 2 commits into
release/6.0from
backport/pr-64398-to-release/6.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Jan 28, 2022

Copy link
Copy Markdown
Contributor

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.

@ghost

Copy link
Copy Markdown

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
Copy Markdown

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:-

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

Copy link
Copy Markdown
Member

@tarekgh

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
Member

Test failure is: #64389

@safern
safern merged commit 9271e5a into release/6.0Feb 7, 2022
@akoeplinger
akoeplinger deleted the backport/pr-64398-to-release/6.0 branch February 10, 2022 17:48
@ghostghost locked as resolved and limited conversation to collaborators Mar 12, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.DateTimeServicing-approvedApproved 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

@tarekgh@safern@ericstj@jeffhandley@leecow