Skip to content

Commit 895c7f5

Browse files
fix: remove serializer settings override code (#197)
* fix: do not override serializer settings * PubNub SDK v6.19.3.0 release. --------- Co-authored-by: PubNub Release Bot <[email protected]>
1 parent 72f8d8f commit 895c7f5

File tree

8 files changed

+33
-23
lines changed

8 files changed

+33
-23
lines changed

.pubnub.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: c-sharp
2-
version: "6.19.2"
2+
version: "6.19.3"
33
schema: 1
44
scm: github.com/pubnub/c-sharp
55
changelog:
6+
- date: 2023-10-31
7+
version: v6.19.3
8+
changes:
9+
- type: bug
10+
text: "Fixes issue of applying default serializer settings."
611
- date: 2023-10-30
712
version: v6.19.2
813
changes:
@@ -751,7 +756,7 @@ features:
751756
- QUERY-PARAM
752757
supported-platforms:
753758
-
754-
version: Pubnub 'C#' 6.19.2
759+
version: Pubnub 'C#' 6.19.3
755760
platforms:
756761
- Windows 10 and up
757762
- Windows Server 2008 and up
@@ -761,7 +766,7 @@ supported-platforms:
761766
- .Net Framework 4.5
762767
- .Net Framework 4.6.1+
763768
-
764-
version: PubnubPCL 'C#' 6.19.2
769+
version: PubnubPCL 'C#' 6.19.3
765770
platforms:
766771
- Xamarin.Android
767772
- Xamarin.iOS
@@ -781,7 +786,7 @@ supported-platforms:
781786
- .Net Core
782787
- .Net 6.0
783788
-
784-
version: PubnubUWP 'C#' 6.19.2
789+
version: PubnubUWP 'C#' 6.19.3
785790
platforms:
786791
- Windows Phone 10
787792
- Universal Windows Apps
@@ -805,7 +810,7 @@ sdks:
805810
distribution-type: source
806811
distribution-repository: GitHub
807812
package-name: Pubnub
808-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.2.0
813+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.3.0
809814
requires:
810815
-
811816
name: ".Net"
@@ -1088,7 +1093,7 @@ sdks:
10881093
distribution-type: source
10891094
distribution-repository: GitHub
10901095
package-name: PubNubPCL
1091-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.2.0
1096+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.3.0
10921097
requires:
10931098
-
10941099
name: ".Net Core"
@@ -1447,7 +1452,7 @@ sdks:
14471452
distribution-type: source
14481453
distribution-repository: GitHub
14491454
package-name: PubnubUWP
1450-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.2.0
1455+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.19.3.0
14511456
requires:
14521457
-
14531458
name: "Universal Windows Platform Development"

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v6.19.3 - October 31 2023
2+
-----------------------------
3+
- Fixed: fixes issue of applying default serializer settings.
4+
15
v6.19.2 - October 30 2023
26
-----------------------------
37
- Modified: changed license to PubNub Software Development Kit License.

src/Api/PubnubApi/NewtonsoftJsonDotNet.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class NewtonsoftJsonDotNet : IJsonPluggableLibrary
1313
{
1414
private readonly PNConfiguration config;
1515
private readonly IPubnubLog pubnubLog;
16+
private readonly JsonSerializerSettings defaultJsonSerializerSettings;
1617
#region "IL2CPP workarounds"
1718
//Got an exception when using JSON serialisation for [],
1819
//IL2CPP needs to know about the array type at compile time.
@@ -44,7 +45,7 @@ public NewtonsoftJsonDotNet(PNConfiguration pubnubConfig, IPubnubLog log)
4445
{
4546
this.config = pubnubConfig;
4647
this.pubnubLog = log;
47-
JsonConvert.DefaultSettings = () => new JsonSerializerSettings { MaxDepth = 64 };
48+
defaultJsonSerializerSettings = new JsonSerializerSettings { MaxDepth = 64 };
4849
}
4950

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

136137
public string SerializeToJsonString(object objectToSerialize)
137138
{
138-
return JsonConvert.SerializeObject(objectToSerialize);
139+
return JsonConvert.SerializeObject(objectToSerialize, defaultJsonSerializerSettings);
139140
}
140141

141142
public List<object> DeserializeToListOfObject(string jsonString)
142143
{
143-
List<object> result = JsonConvert.DeserializeObject<List<object>>(jsonString);
144+
List<object> result = JsonConvert.DeserializeObject<List<object>>(jsonString, defaultJsonSerializerSettings);
144145

145146
return result;
146147
}
@@ -170,7 +171,7 @@ public object DeserializeToObject(string jsonString)
170171

171172
public void PopulateObject(string value, object target)
172173
{
173-
JsonConvert.PopulateObject(value, target);
174+
JsonConvert.PopulateObject(value, target, defaultJsonSerializerSettings);
174175
}
175176

176177
public virtual T DeserializeToObject<T>(string jsonString)
@@ -244,7 +245,7 @@ private T DeserializeMessageToObjectBasedOnPlatform<T>(List<object> listObject)
244245
JToken token = listObject[0] as JToken;
245246
if (dataProp.PropertyType == typeof(string))
246247
{
247-
userMessage = JsonConvert.SerializeObject(token);
248+
userMessage = JsonConvert.SerializeObject(token, defaultJsonSerializerSettings);
248249
}
249250
else
250251
{
@@ -317,7 +318,7 @@ private T DeserializeMessageToObjectBasedOnPlatform<T>(List<object> listObject)
317318
JToken token = listObject[0] as JToken;
318319
if (dataProp.PropertyType == typeof(string))
319320
{
320-
userMessage = JsonConvert.SerializeObject(token);
321+
userMessage = JsonConvert.SerializeObject(token, defaultJsonSerializerSettings);
321322
}
322323
else
323324
{
@@ -1240,7 +1241,7 @@ public Dictionary<string, object> DeserializeToDictionaryOfObject(string jsonStr
12401241
{
12411242
if (JsonFastCheck(jsonString))
12421243
{
1243-
result = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString);
1244+
result = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString, defaultJsonSerializerSettings);
12441245
}
12451246
}
12461247
catch

src/Api/PubnubApi/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
[assembly: AssemblyProduct("Pubnub C# SDK")]
1212
[assembly: AssemblyCopyright("Copyright © 2021")]
1313
[assembly: AssemblyTrademark("")]
14-
[assembly: AssemblyVersion("6.19.2.0")]
15-
[assembly: AssemblyFileVersion("6.19.2.0")]
14+
[assembly: AssemblyVersion("6.19.3.0")]
15+
[assembly: AssemblyFileVersion("6.19.3.0")]
1616
// Setting ComVisible to false makes the types in this assembly not visible
1717
// to COM components. If you need to access a type in this assembly from
1818
// COM, set the ComVisible attribute to true on that type.

src/Api/PubnubApi/PubnubApi.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
<PropertyGroup>
1616
<PackageId>Pubnub</PackageId>
17-
<PackageVersion>6.19.2.0</PackageVersion>
17+
<PackageVersion>6.19.3.0</PackageVersion>
1818
<Title>PubNub C# .NET - Web Data Push API</Title>
1919
<Authors>Pandu Masabathula</Authors>
2020
<Owners>PubNub</Owners>
2121
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2222
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2323
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2424
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
25-
<PackageReleaseNotes>Changed license to PubNub Software Development Kit License.</PackageReleaseNotes>
25+
<PackageReleaseNotes>Fixes issue of applying default serializer settings.</PackageReleaseNotes>
2626
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2727
<!--<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>-->
2828
<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>

src/Api/PubnubApiPCL/PubnubApiPCL.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515

1616
<PropertyGroup>
1717
<PackageId>PubnubPCL</PackageId>
18-
<PackageVersion>6.19.2.0</PackageVersion>
18+
<PackageVersion>6.19.3.0</PackageVersion>
1919
<Title>PubNub C# .NET - Web Data Push API</Title>
2020
<Authors>Pandu Masabathula</Authors>
2121
<Owners>PubNub</Owners>
2222
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2323
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2424
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2525
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
26-
<PackageReleaseNotes>Changed license to PubNub Software Development Kit License.</PackageReleaseNotes>
26+
<PackageReleaseNotes>Fixes issue of applying default serializer settings.</PackageReleaseNotes>
2727
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2828
<!--<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>-->
2929
<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>

src/Api/PubnubApiUWP/PubnubApiUWP.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
<PropertyGroup>
1818
<PackageId>PubnubUWP</PackageId>
19-
<PackageVersion>6.19.2.0</PackageVersion>
19+
<PackageVersion>6.19.3.0</PackageVersion>
2020
<Title>PubNub C# .NET - Web Data Push API</Title>
2121
<Authors>Pandu Masabathula</Authors>
2222
<Owners>PubNub</Owners>
2323
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2424
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2525
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2626
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
27-
<PackageReleaseNotes>Changed license to PubNub Software Development Kit License.</PackageReleaseNotes>
27+
<PackageReleaseNotes>Fixes issue of applying default serializer settings.</PackageReleaseNotes>
2828
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2929
<!--<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>-->
3030
<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>

src/Api/PubnubApiUnity/PubnubApiUnity.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<PropertyGroup>
1717
<PackageId>PubnubApiUnity</PackageId>
18-
<PackageVersion>6.19.2.0</PackageVersion>
18+
<PackageVersion>6.19.3.0</PackageVersion>
1919
<Title>PubNub C# .NET - Web Data Push API</Title>
2020
<Authors>Pandu Masabathula</Authors>
2121
<Owners>PubNub</Owners>

0 commit comments

Comments
 (0)