Repository navigation
Conversation
Breadcrumb.FromJson upper-cased the level with the current culture. Under tr-TR, "warning" becomes "WARNİNG", matches no case and falls back to Info. NativeScopeObserver lower-cased the level the same way, sending "ınfo" to the native SDK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR risk: mediumFor commit The model rated this change low. It was raised to medium because:
This label is a hint for reviewers, not an approval. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Breadcrumb.FromJsonupper-cases thelevelwithToUpper(), which uses the current culture. Under a Turkish (or Azerbaijani) culture,"warning"becomes"WARNİNG"(dotted capital I), matches none of the cases and falls back toInfo. A warning breadcrumb read back from JSON, for example from a cached envelope, loses its level on those machines. This PR usesToUpperInvariant()instead.NativeScopeObserverhas the same problem in the other direction:breadcrumb.Level.ToString().ToLower()turnsInfointo"ınfo"(dotless i) before passing it to the native SDK. It now usesToLowerInvariant(), likeBreadcrumb.WriteToalready does.Tests: added
FromJson_Level_UnderTurkishCulture_ParsesExpectedLevel, which sets tr-TR and parses"warning"and"debug".I ran
Sentry.Testson net10.0 on a machine whose culture is tr-TR:FromJson_Level_ParsesExpectedLevel("warning"), and the twoSerializeObject_AllPropertiesSetToNonDefaultround trips inSentryEventTestsandSentryTransactionTests, which include a warning breadcrumb;Issues
No existing issue; found while checking .NET libraries for culture-dependent casing.
This PR was prepared with AI assistance (Claude Code); I reviewed the change and ran the tests above.
🤖 Generated with Claude Code