From 81a02f7cfd563448a3abc9d3c665eeba3ac09da5 Mon Sep 17 00:00:00 2001 From: LaunchDarklyReleaseBot <86431345+LaunchDarklyReleaseBot@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:42:01 -0500 Subject: [PATCH] prepare 2.0.4 release (#52) * add helper scripts * Changed Online to use WaitSafely instead of storing result in a var * Added identical value check to SetOnlineAsync * Move value check inside of lock for Android unit test * Added second value check inside Online, moved value check into try in SetOnlineAsync * disable REPORT mode because it doesn't work in Android yet * refactor connection state management, replace Online property with Offline, etc. (#74) * remove HttpClientTimeout in configuration, use ConnectionTimeout (#77) * misc fixes to background mode logic, add tests for it (#78) * fix comments * misc fixes for flaky tests * update WireMock, re-enable HTTP tests for Android * more stable way of synchronizing the background mode tests * put event processor off/online based on Offline property + network status * don't post more events if we're offline * don't send identify event if we're offline * generate XML comment files * try skipping XML step in Android CI job because msbuild will fail * rm unused type * XML comment fixes * version 1.0.0-beta23 * changelog additions * don't use Plugin.DeviceInfo for iOS * don't use Plugin.DeviceInfo for Android * don't call the platform-specific method directly * add tests for device ID * adjust target frameworks for restwrapper CI builds * adjust target frameworks for restwrapper CI builds * add Sandcastle doc build script + general doc comment cleanup * fix "Launchdarkly" * symbol style for Json namespace * remove JToken from public APIs and nearly everywhere else * rename ImmutableJsonValue to LdValue, don't use ValueType * fix dependency * fix tests * fix type checking * disable annoying date parsing behavior * make flag data immutable and stop re-parsing it all the time * fix source file reference * configure Android HTTP client to do timeouts correctly. * typo * version 1.0.0-beta24 * changelog update * version 1.0.0 * use CommonSdk 4.1.0 * fix dependency * update test data because User.Anonymous was fixed to default to null instead of false * linefeeds * use CommonSDK 4.2.0 (adds log helper) * version 1.1.0 * set default background polling interval * fix csproj reference to MSBuild.Sdk.Extras * need to keep PackageReference? * try to fix test build * fix MSBuild.Sdk.Extras again (https://github.com/onovotny/MSBuildSdkExtras/blob/master/README.md) * try another project file format change * more project config fixes * brew cask is built-in now * explicit TargetFramework * set OutputPath * rm redundant assembly info * more project fixes * misc project fixes * add SDK version config * changelog update * changelog update * use CommonSdk 4.2.1 * fix tests (user JSON no longer includes pointless "custom":{}) * version 1.1.1 * add EnumVariation extension methods * update CommonSdk, don't use deprecated reason types * use transformed user, not original user, when requesting flags after Identify * fix some more deprecated usages * fix some more deprecated usages * fix test logic for detecting generated user key * use CommonSdk 4.3.0 * update CommonSdk to 4.3.1 for event payload ID fix * version 1.2.0 * project file cleanup * revert project file change * try setting CodesignKey * build in debug mode * set platform explicitly to simulator in CI * use Xcode 11.3 in CI * fix brew install of Xamarin tools * fix iOS build path * add comment, rm unnecessary property * execute Xamarin SDK releases via Releaser (#98) * fix Android CI build (#99) * Removed the guides link * don't drop base paths from custom base URIs * Update base64 encoding of user JSON to be URL safe. (#102) * make the Android CI build work (#103) * Removed redundant dependencies on android support libraries. This allows to use the package with mono droid 10 and Jetpack. (#104) Co-authored-by: Vladimir-Mischenchuk * better install logic for CI and release (#105) * prevent spurious dependencies in package build * Set up mysterious ibtool fix. (#108) This is a rather unexplained workaround for the iOS CI job being non-functional. I unfortunately do not have any good explanation for _why_ this works. There's some sort of :ghost: statefulness going on that I can't explain. Regardless, this does allow the `msbuild` to complete successfully and tests to run. There's still some sort of issue when actually running the tests related to `System.IO.Pipelines`, but I haven't looked into that. * use EmbedIO instead of WireMock.Net for embedded HTTP server in tests * support ping message used by Relay stream endpoint * add lower-level test coverage * (2.0 - #1) minimum changes to migrate to newer common packages that are used by .NET SDK 6.0 (#100) * (2.0 - #2) remove Newtonsoft.Json (#106) * improve EnumVariation with type constraint, fix tests * use LaunchDarkly.TestHelpers for HTTP tests * fix project files * fix project files * update to latest InternalSdk, misc cleanup, better test code sharing (#114) * better workaround for iOS storyboard build problem (#115) * update dependencies to latest releases * drop support for Android 7.1 and 8.0 * (#1) code reorganization, standardize namespaces (#117) * (#2) rename SDK in the readme and project names (#118) * (#3) rename Xamarin to Client in namespaces & assemblies (#119) * (#4) add logging configuration and per-platform default loggers (#120) * implement Alias method and auto-aliasing * misc test fixes * remove IConfigurationBuilder interface * doc comment fixes + add files for new doc generator * rm obsolete file * Apply suggestions from code review Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com> * clarify CommonSdk documentation * (#4) add IDataSource interface & more component infrastructure similar to dotnet-server-sdk (#124) * (#5) scoped configuration & public interface for events (#125) * (#6) scoped configuration for HTTP (#126) * (#1) reimplement data store components for cleaner abstraction of persistence, make it configurable (#127) * (#2) misc tedious code cleanup of property/method naming (#128) * (#3) revise flag notification mechanism to look more like the server-side SDK (#129) * (#4) implement test data source (#130) * (#5) use new concurrency helpers in dotnet-sdk-internal (#131) * data source status API * comments * make build fail if XML comments are missing or invalid * doc comment fixes * doc comment fix * set default flush interval to 30 seconds on mobile platforms * simpler way of configuring service base URIs (#134) * add DoubleVariation and DoubleVariationDetail * enable REPORT mode, except on Android * configure TaskExecutor to call event handlers on main thread in Android/iOS * add guard on writing to Xunit test output * implement diagnostic events (#137) * fix HttpMessageHandler + proxy configuration, add test coverage (#141) * fix HttpMessageHandler + proxy configuration, add test coverage * fix test package dependencies * re-fix dependencies * update MSBuild.Sdk.Extras to prevent spurious build warnings from .NET 5 tools * new persistent storage implementation + max users limit (#143) * better data source test coverage + misc bugfixes (#144) * use Releaser v2 configuration (#135) * add Authenticode signing in release builds; remove obsolete scripts (#145) * add prerelease notice * add strong naming in release build * revise local storage usage to only use base64url-safe characters in namespaces/keys * fix test package build script * remove ReadTimeout setting which only worked in Android but not in a useful way * refactor ConnectionManager state management to handle diagnostic events correctly * fix init logic, add tests * remove prerelease notice from readme for GA release * update CommonSdk & InternalSdk to latest releases + delete obsolete project file * Use CircleCI macOS Gen2 resource class. (#152) * fix unset timestamp in alias events * contract test service implementation (#154) * Change master to main. (#155) * fix Android & iOS CI builds * typo * use more correct path for release credential parameter * bump LaunchDarkly.Logging to v1.0.2 for sc-177921 * fix release build to use newer osslsigncode (for 2.x) * Update release branch configuration. * build(dep): Update LaunchDarkly.JsonStream and add an invariant culture test. (#183) * build(dep): Update to JsonStream 1.1.2 and add a User serialization test. (#184) --------- Co-authored-by: Eli Bishop Co-authored-by: torchhound <5600929+torchhound@users.noreply.github.com> Co-authored-by: Ben Woskow Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com> Co-authored-by: Gavin Whelan Co-authored-by: Vladimir-Mischenchuk Co-authored-by: LaunchDarklyReleaseBot Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> --- .../LaunchDarkly.ClientSdk.csproj | 2 +- .../Internal/DataModelSerializationTest.cs | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/LaunchDarkly.ClientSdk/LaunchDarkly.ClientSdk.csproj b/src/LaunchDarkly.ClientSdk/LaunchDarkly.ClientSdk.csproj index 018b36c2..cf6d96c8 100644 --- a/src/LaunchDarkly.ClientSdk/LaunchDarkly.ClientSdk.csproj +++ b/src/LaunchDarkly.ClientSdk/LaunchDarkly.ClientSdk.csproj @@ -43,7 +43,7 @@ - + diff --git a/tests/LaunchDarkly.ClientSdk.Tests/Internal/DataModelSerializationTest.cs b/tests/LaunchDarkly.ClientSdk.Tests/Internal/DataModelSerializationTest.cs index 7b92963a..0d003cbb 100644 --- a/tests/LaunchDarkly.ClientSdk.Tests/Internal/DataModelSerializationTest.cs +++ b/tests/LaunchDarkly.ClientSdk.Tests/Internal/DataModelSerializationTest.cs @@ -1,4 +1,5 @@ using System.Globalization; +using System.Text.RegularExpressions; using LaunchDarkly.Sdk.Client.Interfaces; using LaunchDarkly.Sdk.Json; using Xunit; @@ -19,6 +20,20 @@ public void SerializeUser() DataModelSerialization.SerializeUser(user)); } + [Theory] + [InlineData("fr-FR")] + [InlineData("de")] + [InlineData("en-US")] + public void SerializeUserIsInvariantToCulture(string cultureName) + { + System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName); + System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureName); + var user = User.Builder("user-key").Custom("doubleValue", 0.5).Build(); + // Will serialize an LDValue. Which would also be the same type for flag values. + var serialized = LdJsonSerialization.SerializeObject(user); + Assert.Matches(new Regex(".*{\"doubleValue\":0\\.5}.*"), serialized); + } + [Fact] public void SerializeFlagWithMinimalProperties() { @@ -100,7 +115,7 @@ public void DeserializeAll() [InlineData("fr-FR")] [InlineData("de")] [InlineData("en-US")] - public void SerializationIsInvariantToCulture(string cultureName) + public void DeserializationIsInvariantToCulture(string cultureName) { System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName); System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureName);