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 incorrect json array returned for locales with comma as decimal separator in TelemetryUtility.ToJsonArrayOfTimingsInSeconds #5441

Conversation

dotnokato
Copy link
Contributor

Bug

Fixes: NuGet/Home#12915

Regression? Last working version:

Description

Related to: NuGet/Home#12820

TelemetryUtility.ToJsonArrayOfTimingsInSeconds returns incorrect json array on locales having comma as a decimal separator

Running test NuGet.VisualStudio.Common.Test.Telemetry.TelemetryUtilityTests.ToJsonArrayOfTimingsInSeconds_WithMultipleValues_AppendsValuesWithComma on system with such locales (e.g. de) fails with the following error:

Expected TelemetryUtility.ToJsonArrayOfTimingsInSeconds(values) to be "[5,60.5]", but "[5,60,5]" differs near ",5]" (index 5).

This PR:

  • updates the above test to surface the issue when running in the test regardless of system's locale
  • fixes the issue

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@dotnokato dotnokato requested a review from a team as a code owner October 1, 2023 19:22
@ghost ghost added the Community PRs created by someone not in the NuGet team label Oct 1, 2023
jeffkl
jeffkl previously approved these changes Oct 2, 2023
@jeffkl jeffkl self-assigned this Oct 2, 2023
@jeffkl jeffkl enabled auto-merge (squash) October 11, 2023 16:39
@jeffkl jeffkl merged commit 5ce332f into NuGet:dev Oct 11, 2023
@dotnokato dotnokato deleted the dev-dotnokato-incorrect-json-array-fix-ToJsonArrayOfTimingsInSeconds branch October 11, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PRs created by someone not in the NuGet team
Projects
None yet
3 participants