Skip to content

Do not cache NSLocale.current if we fail to fetch preferences #1134

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

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

itingliu
Copy link
Contributor

Currently, we do not cache the current Swift locale if we cannot fetch proper preferences. This allows us to update the cached value if subsequent access succeeds.

We should be doing that for currentNSLocale too, but we are not. Fix the logic so that the behaviors match.

Resolves rdar://142699797

Currently, we do not cache the current Swift locale if we cannot fetch proper preferences. This allows us to update the cached value if subsequent access succeeds.

We should be doing that for `currentNSLocale` too, but we are not. Fix the logic so that the behaviors match.

Resolves rdar://142699797
@itingliu itingliu requested a review from parkera January 22, 2025 21:16
@itingliu
Copy link
Contributor Author

@swift-ci please test

@itingliu itingliu merged commit 963de65 into swiftlang:main Jan 23, 2025
2 of 3 checks passed
@itingliu itingliu deleted the nslocale-current-cache branch January 23, 2025 17:15
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.

2 participants