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 microsoft/vscode#209655: fix case-sensitive JSON sorting error #238

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

ttlopes
Copy link
Contributor

@ttlopes ttlopes commented Jul 21, 2024

Summary

This PR fixes the case-sensitive JSON sorting error described in microsoft/vscode#209655. The issue caused incorrect sorting of JSON properties with mixed-case names, like "test" and "Test".

Details

The problem was due to the sorting mechanism not handling case sensitivity properly, causing it to sort properties at random since it didn't know how to handle the mixed-case names. A new function was introduced to sort properties in a case-sensitive manner, ensuring accurate ordering of property names.

Testing

Two unit tests were added:

  1. An unsorted array to verify it sorts correctly.
  2. An already sorted array to confirm it remains unchanged.

These tests cover the description of the issue.

This fix ensures that JSON properties are sorted correctly, addressing the reported issue.

@ttlopes
Copy link
Contributor Author

ttlopes commented Jul 21, 2024

@microsoft-github-policy-service agree

@aeschli
Copy link
Contributor

aeschli commented Aug 26, 2024

Thanks @ttlopes !

@aeschli aeschli enabled auto-merge August 26, 2024 17:44
@vs-code-engineering vs-code-engineering bot added this to the August 2024 milestone Aug 26, 2024
@aeschli aeschli merged commit bf616c2 into microsoft:main Aug 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants