configcat / .net-sdk

ConfigCat SDK for .NET. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/csharp
Other
29 stars 8 forks source link

Ensure internal serializer doesn't use the global json serializer settings #21

Closed z4kn4fein closed 3 years ago

z4kn4fein commented 3 years ago

Describe the purpose of your pull request

Users can unintentionally give bad settings to the SDK through json.NET's JsonConvert.DefaultSettings static property. This PR changes the serializer handling towards a single serializer instance rather than the static JsonConvert methods. They always use the DefaultSettings, even when you override their settings parameter.

Related issues (only if applicable)

n/a

Requirement checklist (only if applicable)

codecov[bot] commented 3 years ago

Codecov Report

Merging #21 (ece321d) into master (04cb4cd) will increase coverage by 3.32%. The diff coverage is 97.43%.

:exclamation: Current head ece321d differs from pull request most recent head a323e69. Consider uploading reports for the commit a323e69 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
+ Coverage   93.57%   96.89%   +3.32%     
==========================================
  Files          27       27              
  Lines         700      708       +8     
  Branches      160       71      -89     
==========================================
+ Hits          655      686      +31     
  Misses         12       12              
+ Partials       33       10      -23     
Impacted Files Coverage Δ
src/ConfigCatClient/HttpConfigFetcher.cs 96.55% <96.29%> (+6.07%) :arrow_up:
src/ConfigCatClient/ConfigCatClient.cs 92.48% <100.00%> (+2.32%) :arrow_up:
src/ConfigCatClient/ConfigDeserializer.cs 100.00% <100.00%> (ø)
src/ConfigCatClient/Evaluate/RolloutEvaluator.cs 97.66% <0.00%> (+2.33%) :arrow_up:
...igCatClient/ConfigService/AutoPollConfigService.cs 100.00% <0.00%> (+15.62%) :arrow_up:
...igCatClient/ConfigService/LazyLoadConfigService.cs 100.00% <0.00%> (+18.75%) :arrow_up:
...CatClient/ConfigService/ManualPollConfigService.cs 100.00% <0.00%> (+42.85%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4582a83...a323e69. Read the comment docs.