Skip to content

Commit

Permalink
fix: remove serializer settings override code (#197)
Browse files Browse the repository at this point in the history
* fix: do not override serializer settings

* PubNub SDK v6.19.3.0 release.

---------

Co-authored-by: PubNub Release Bot <[email protected]>
  • Loading branch information
mohitpubnub and pubnub-release-bot authored Oct 31, 2023
1 parent 72f8d8f commit 895c7f5
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 23 deletions.
19 changes: 12 additions & 7 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: c-sharp
version: "6.19.2"
version: "6.19.3"
schema: 1
scm: github.com/pubnub/c-sharp
changelog:
- date: 2023-10-31
version: v6.19.3
changes:
- type: bug
text: "Fixes issue of applying default serializer settings."
- date: 2023-10-30
version: v6.19.2
changes:
Expand Down Expand Up @@ -751,7 +756,7 @@ features:
- QUERY-PARAM
supported-platforms:
-
version: Pubnub 'C#' 6.19.2
version: Pubnub 'C#' 6.19.3
platforms:
- Windows 10 and up
- Windows Server 2008 and up
Expand All @@ -761,7 +766,7 @@ supported-platforms:
- .Net Framework 4.5
- .Net Framework 4.6.1+
-
version: PubnubPCL 'C#' 6.19.2
version: PubnubPCL 'C#' 6.19.3
platforms:
- Xamarin.Android
- Xamarin.iOS
Expand All @@ -781,7 +786,7 @@ supported-platforms:
- .Net Core
- .Net 6.0
-
version: PubnubUWP 'C#' 6.19.2
version: PubnubUWP 'C#' 6.19.3
platforms:
- Windows Phone 10
- Universal Windows Apps
Expand All @@ -805,7 +810,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: Pubnub
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.2.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.3.0
requires:
-
name: ".Net"
Expand Down Expand Up @@ -1088,7 +1093,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubNubPCL
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.2.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.3.0
requires:
-
name: ".Net Core"
Expand Down Expand Up @@ -1447,7 +1452,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubnubUWP
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.2.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.3.0
requires:
-
name: "Universal Windows Platform Development"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v6.19.3 - October 31 2023
-----------------------------
- Fixed: fixes issue of applying default serializer settings.

v6.19.2 - October 30 2023
-----------------------------
- Modified: changed license to PubNub Software Development Kit License.
Expand Down
15 changes: 8 additions & 7 deletions src/Api/PubnubApi/NewtonsoftJsonDotNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class NewtonsoftJsonDotNet : IJsonPluggableLibrary
{
private readonly PNConfiguration config;
private readonly IPubnubLog pubnubLog;
private readonly JsonSerializerSettings defaultJsonSerializerSettings;
#region "IL2CPP workarounds"
//Got an exception when using JSON serialisation for [],
//IL2CPP needs to know about the array type at compile time.
Expand Down Expand Up @@ -44,7 +45,7 @@ public NewtonsoftJsonDotNet(PNConfiguration pubnubConfig, IPubnubLog log)
{
this.config = pubnubConfig;
this.pubnubLog = log;
JsonConvert.DefaultSettings = () => new JsonSerializerSettings { MaxDepth = 64 };
defaultJsonSerializerSettings = new JsonSerializerSettings { MaxDepth = 64 };
}

#region IJsonPlugableLibrary methods implementation
Expand Down Expand Up @@ -135,12 +136,12 @@ public bool IsDictionaryCompatible(string jsonString, PNOperationType operationT

public string SerializeToJsonString(object objectToSerialize)
{
return JsonConvert.SerializeObject(objectToSerialize);
return JsonConvert.SerializeObject(objectToSerialize, defaultJsonSerializerSettings);
}

public List<object> DeserializeToListOfObject(string jsonString)
{
List<object> result = JsonConvert.DeserializeObject<List<object>>(jsonString);
List<object> result = JsonConvert.DeserializeObject<List<object>>(jsonString, defaultJsonSerializerSettings);

return result;
}
Expand Down Expand Up @@ -170,7 +171,7 @@ public object DeserializeToObject(string jsonString)

public void PopulateObject(string value, object target)
{
JsonConvert.PopulateObject(value, target);
JsonConvert.PopulateObject(value, target, defaultJsonSerializerSettings);
}

public virtual T DeserializeToObject<T>(string jsonString)
Expand Down Expand Up @@ -244,7 +245,7 @@ private T DeserializeMessageToObjectBasedOnPlatform<T>(List<object> listObject)
JToken token = listObject[0] as JToken;
if (dataProp.PropertyType == typeof(string))
{
userMessage = JsonConvert.SerializeObject(token);
userMessage = JsonConvert.SerializeObject(token, defaultJsonSerializerSettings);
}
else
{
Expand Down Expand Up @@ -317,7 +318,7 @@ private T DeserializeMessageToObjectBasedOnPlatform<T>(List<object> listObject)
JToken token = listObject[0] as JToken;
if (dataProp.PropertyType == typeof(string))
{
userMessage = JsonConvert.SerializeObject(token);
userMessage = JsonConvert.SerializeObject(token, defaultJsonSerializerSettings);
}
else
{
Expand Down Expand Up @@ -1240,7 +1241,7 @@ public Dictionary<string, object> DeserializeToDictionaryOfObject(string jsonStr
{
if (JsonFastCheck(jsonString))
{
result = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString);
result = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString, defaultJsonSerializerSettings);
}
}
catch
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApi/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
[assembly: AssemblyProduct("Pubnub C# SDK")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("6.19.2.0")]
[assembly: AssemblyFileVersion("6.19.2.0")]
[assembly: AssemblyVersion("6.19.3.0")]
[assembly: AssemblyFileVersion("6.19.3.0")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApi/PubnubApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

<PropertyGroup>
<PackageId>Pubnub</PackageId>
<PackageVersion>6.19.2.0</PackageVersion>
<PackageVersion>6.19.3.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
<PackageReleaseNotes>Changed license to PubNub Software Development Kit License.</PackageReleaseNotes>
<PackageReleaseNotes>Fixes issue of applying default serializer settings.</PackageReleaseNotes>
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApiPCL/PubnubApiPCL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

<PropertyGroup>
<PackageId>PubnubPCL</PackageId>
<PackageVersion>6.19.2.0</PackageVersion>
<PackageVersion>6.19.3.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
<PackageReleaseNotes>Changed license to PubNub Software Development Kit License.</PackageReleaseNotes>
<PackageReleaseNotes>Fixes issue of applying default serializer settings.</PackageReleaseNotes>
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApiUWP/PubnubApiUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

<PropertyGroup>
<PackageId>PubnubUWP</PackageId>
<PackageVersion>6.19.2.0</PackageVersion>
<PackageVersion>6.19.3.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
<PackageReleaseNotes>Changed license to PubNub Software Development Kit License.</PackageReleaseNotes>
<PackageReleaseNotes>Fixes issue of applying default serializer settings.</PackageReleaseNotes>
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/Api/PubnubApiUnity/PubnubApiUnity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<PropertyGroup>
<PackageId>PubnubApiUnity</PackageId>
<PackageVersion>6.19.2.0</PackageVersion>
<PackageVersion>6.19.3.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
Expand Down

0 comments on commit 895c7f5

Please sign in to comment.