Skip to content

Commit

Permalink
capture region when exception occur (#126)
Browse files Browse the repository at this point in the history
* capture region when exception occur
  • Loading branch information
budgetpreneur authored Jan 20, 2022
1 parent 24f0f60 commit 4b5f576
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 17 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.0.0"
version: "6.1.0"
schema: 1
scm: github.com/pubnub/c-sharp
changelog:
- date: 2022-01-20
version: v6.1.0
changes:
- type: bug
text: "Capture region when exception occur during subscribe."
- date: 2022-01-12
version: v6.0.0
changes:
Expand Down Expand Up @@ -626,7 +631,7 @@ features:
- QUERY-PARAM
supported-platforms:
-
version: Pubnub 'C#' 6.0.0
version: Pubnub 'C#' 6.1.0
platforms:
- Windows 10 and up
- Windows Server 2008 and up
Expand All @@ -636,7 +641,7 @@ supported-platforms:
- .Net Framework 4.5
- .Net Framework 4.6.1+
-
version: PubnubPCL 'C#' 6.0.0
version: PubnubPCL 'C#' 6.1.0
platforms:
- Xamarin.Android
- Xamarin.iOS
Expand All @@ -655,7 +660,7 @@ supported-platforms:
- .Net Standard 2.1
- .Net Core
-
version: PubnubUWP 'C#' 6.0.0
version: PubnubUWP 'C#' 6.1.0
platforms:
- Windows Phone 10
- Universal Windows Apps
Expand All @@ -679,7 +684,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: Pubnub
location: https://github.com/pubnub/c-sharp/releases/tag/v6.0.0.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.1.0.0
requires:
-
name: ".Net"
Expand Down Expand Up @@ -976,7 +981,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubNubPCL
location: https://github.com/pubnub/c-sharp/releases/tag/v6.0.0.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.1.0.0
requires:
-
name: ".Net Core"
Expand Down Expand Up @@ -1349,7 +1354,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubnubUWP
location: https://github.com/pubnub/c-sharp/releases/tag/v6.0.0.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.1.0.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.1.0 - January 20 2022
-----------------------------
- Fixed: capture region when exception occur during subscribe.

v6.0.0 - January 12 2022
-----------------------------
- BREAKING CHANGES: UUID is mandatory to use SDK.
Expand Down
13 changes: 11 additions & 2 deletions src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,16 @@ private void MultiplexExceptionHandler<T>(PNOperationType type, string[] channel
}
else
{
result.Add(LastSubscribeTimetoken[PubnubInstance.InstanceId]); //get last timetoken of the current instance
long lastTT = LastSubscribeTimetoken[PubnubInstance.InstanceId]; //get last timetoken of the current instance
int lastRegionId = (LastSubscribeRegion != null && LastSubscribeRegion.ContainsKey(PubnubInstance.InstanceId)) ? LastSubscribeRegion[PubnubInstance.InstanceId] : 0; //get last region of the current instance

Dictionary<string, object> dictTimetokenAndRegion = new Dictionary<string, object>();
dictTimetokenAndRegion.Add("t", lastTT);
dictTimetokenAndRegion.Add("r", lastRegionId);

Dictionary<string, object> dictEnvelope = new Dictionary<string, object>();
dictEnvelope.Add("t", dictTimetokenAndRegion);
result.Add(dictEnvelope);
}

if (channelGroups != null && channelGroups.Length > 0)
Expand Down Expand Up @@ -831,7 +840,7 @@ private void MultiplexInternalCallback<T>(PNOperationType type, object multiplex
int region = GetRegionFromMultiplexResult(message);
Task.Factory.StartNew(() =>
{
LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0} MultiplexInternalCallback timetoken = {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), timetoken), config.LogVerbosity);
LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0} MultiplexInternalCallback timetoken = {1}; region = {2}", DateTime.Now.ToString(CultureInfo.InvariantCulture), timetoken, region), config.LogVerbosity);
MultiChannelSubscribeRequest<T>(type, channels, channelGroups, timetoken, region, false, null, this.customQueryParam);
}, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false);
}
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.0.0.0")]
[assembly: AssemblyFileVersion("6.0.0.0")]
[assembly: AssemblyVersion("6.1.0.0")]
[assembly: AssemblyFileVersion("6.1.0.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 @@ -13,15 +13,15 @@

<PropertyGroup>
<PackageId>Pubnub</PackageId>
<PackageVersion>6.0.0.0</PackageVersion>
<PackageVersion>6.1.0.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>BREAKING CHANGES: UUID is mandatory to use SDK.</PackageReleaseNotes>
<PackageReleaseNotes>Capture region when exception occur during subscribe.</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 @@ -14,15 +14,15 @@

<PropertyGroup>
<PackageId>PubnubPCL</PackageId>
<PackageVersion>6.0.0.0</PackageVersion>
<PackageVersion>6.1.0.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>BREAKING CHANGES: UUID is mandatory to use SDK.</PackageReleaseNotes>
<PackageReleaseNotes>Capture region when exception occur during subscribe.</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 @@ -15,15 +15,15 @@

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

0 comments on commit 4b5f576

Please sign in to comment.