Skip to content

Commit 4b5f576

Browse files
capture region when exception occur (#126)
* capture region when exception occur
1 parent 24f0f60 commit 4b5f576

File tree

7 files changed

+35
-17
lines changed

7 files changed

+35
-17
lines changed

.pubnub.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: c-sharp
2-
version: "6.0.0"
2+
version: "6.1.0"
33
schema: 1
44
scm: github.com/pubnub/c-sharp
55
changelog:
6+
- date: 2022-01-20
7+
version: v6.1.0
8+
changes:
9+
- type: bug
10+
text: "Capture region when exception occur during subscribe."
611
- date: 2022-01-12
712
version: v6.0.0
813
changes:
@@ -626,7 +631,7 @@ features:
626631
- QUERY-PARAM
627632
supported-platforms:
628633
-
629-
version: Pubnub 'C#' 6.0.0
634+
version: Pubnub 'C#' 6.1.0
630635
platforms:
631636
- Windows 10 and up
632637
- Windows Server 2008 and up
@@ -636,7 +641,7 @@ supported-platforms:
636641
- .Net Framework 4.5
637642
- .Net Framework 4.6.1+
638643
-
639-
version: PubnubPCL 'C#' 6.0.0
644+
version: PubnubPCL 'C#' 6.1.0
640645
platforms:
641646
- Xamarin.Android
642647
- Xamarin.iOS
@@ -655,7 +660,7 @@ supported-platforms:
655660
- .Net Standard 2.1
656661
- .Net Core
657662
-
658-
version: PubnubUWP 'C#' 6.0.0
663+
version: PubnubUWP 'C#' 6.1.0
659664
platforms:
660665
- Windows Phone 10
661666
- Universal Windows Apps
@@ -679,7 +684,7 @@ sdks:
679684
distribution-type: source
680685
distribution-repository: GitHub
681686
package-name: Pubnub
682-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.0.0.0
687+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.1.0.0
683688
requires:
684689
-
685690
name: ".Net"
@@ -976,7 +981,7 @@ sdks:
976981
distribution-type: source
977982
distribution-repository: GitHub
978983
package-name: PubNubPCL
979-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.0.0.0
984+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.1.0.0
980985
requires:
981986
-
982987
name: ".Net Core"
@@ -1349,7 +1354,7 @@ sdks:
13491354
distribution-type: source
13501355
distribution-repository: GitHub
13511356
package-name: PubnubUWP
1352-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.0.0.0
1357+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.1.0.0
13531358
requires:
13541359
-
13551360
name: "Universal Windows Platform Development"

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v6.1.0 - January 20 2022
2+
-----------------------------
3+
- Fixed: capture region when exception occur during subscribe.
4+
15
v6.0.0 - January 12 2022
26
-----------------------------
37
- BREAKING CHANGES: UUID is mandatory to use SDK.

src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,16 @@ private void MultiplexExceptionHandler<T>(PNOperationType type, string[] channel
783783
}
784784
else
785785
{
786-
result.Add(LastSubscribeTimetoken[PubnubInstance.InstanceId]); //get last timetoken of the current instance
786+
long lastTT = LastSubscribeTimetoken[PubnubInstance.InstanceId]; //get last timetoken of the current instance
787+
int lastRegionId = (LastSubscribeRegion != null && LastSubscribeRegion.ContainsKey(PubnubInstance.InstanceId)) ? LastSubscribeRegion[PubnubInstance.InstanceId] : 0; //get last region of the current instance
788+
789+
Dictionary<string, object> dictTimetokenAndRegion = new Dictionary<string, object>();
790+
dictTimetokenAndRegion.Add("t", lastTT);
791+
dictTimetokenAndRegion.Add("r", lastRegionId);
792+
793+
Dictionary<string, object> dictEnvelope = new Dictionary<string, object>();
794+
dictEnvelope.Add("t", dictTimetokenAndRegion);
795+
result.Add(dictEnvelope);
787796
}
788797

789798
if (channelGroups != null && channelGroups.Length > 0)
@@ -831,7 +840,7 @@ private void MultiplexInternalCallback<T>(PNOperationType type, object multiplex
831840
int region = GetRegionFromMultiplexResult(message);
832841
Task.Factory.StartNew(() =>
833842
{
834-
LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0} MultiplexInternalCallback timetoken = {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), timetoken), config.LogVerbosity);
843+
LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0} MultiplexInternalCallback timetoken = {1}; region = {2}", DateTime.Now.ToString(CultureInfo.InvariantCulture), timetoken, region), config.LogVerbosity);
835844
MultiChannelSubscribeRequest<T>(type, channels, channelGroups, timetoken, region, false, null, this.customQueryParam);
836845
}, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false);
837846
}

src/Api/PubnubApi/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
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.0.0.0")]
15-
[assembly: AssemblyFileVersion("6.0.0.0")]
14+
[assembly: AssemblyVersion("6.1.0.0")]
15+
[assembly: AssemblyFileVersion("6.1.0.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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
<PropertyGroup>
1515
<PackageId>Pubnub</PackageId>
16-
<PackageVersion>6.0.0.0</PackageVersion>
16+
<PackageVersion>6.1.0.0</PackageVersion>
1717
<Title>PubNub C# .NET - Web Data Push API</Title>
1818
<Authors>Pandu Masabathula</Authors>
1919
<Owners>PubNub</Owners>
2020
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2121
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2222
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2323
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
24-
<PackageReleaseNotes>BREAKING CHANGES: UUID is mandatory to use SDK.</PackageReleaseNotes>
24+
<PackageReleaseNotes>Capture region when exception occur during subscribe.</PackageReleaseNotes>
2525
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2626
<!--<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>-->
2727
<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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
<PropertyGroup>
1616
<PackageId>PubnubPCL</PackageId>
17-
<PackageVersion>6.0.0.0</PackageVersion>
17+
<PackageVersion>6.1.0.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>BREAKING CHANGES: UUID is mandatory to use SDK.</PackageReleaseNotes>
25+
<PackageReleaseNotes>Capture region when exception occur during subscribe.</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/PubnubApiUWP/PubnubApiUWP.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515

1616
<PropertyGroup>
1717
<PackageId>PubnubUWP</PackageId>
18-
<PackageVersion>6.0.0.0</PackageVersion>
18+
<PackageVersion>6.1.0.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>BREAKING CHANGES: UUID is mandatory to use SDK.</PackageReleaseNotes>
26+
<PackageReleaseNotes>Capture region when exception occur during subscribe.</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>

0 commit comments

Comments
 (0)