Skip to content

Commit 39a3f56

Browse files
mohitpubnubMohit Tejanipubnub-release-bot
authored
refactor: emit status function (#267)
* refactor: emit status function, to avoid concurrent modifictaion error issue * PubNub SDK v8.0.3 release. --------- Co-authored-by: Mohit Tejani <[email protected]> Co-authored-by: PubNub Release Bot <[email protected]>
1 parent ece74f6 commit 39a3f56

File tree

8 files changed

+39
-24
lines changed

8 files changed

+39
-24
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: "8.0.2"
2+
version: "8.0.3"
33
schema: 1
44
scm: github.com/pubnub/c-sharp
55
changelog:
6+
- date: 2025-11-20
7+
version: v8.0.3
8+
changes:
9+
- type: improvement
10+
text: "Refactor EmitStatus to prevent concurrent modification issue resulting InvalidOperationException."
611
- date: 2025-11-17
712
version: v8.0.2
813
changes:
@@ -962,7 +967,7 @@ features:
962967
- QUERY-PARAM
963968
supported-platforms:
964969
-
965-
version: Pubnub 'C#' 8.0.2
970+
version: Pubnub 'C#' 8.0.3
966971
platforms:
967972
- Windows 10 and up
968973
- Windows Server 2008 and up
@@ -973,7 +978,7 @@ supported-platforms:
973978
- .Net Framework 4.6.1+
974979
- .Net Framework 6.0
975980
-
976-
version: PubnubPCL 'C#' 8.0.2
981+
version: PubnubPCL 'C#' 8.0.3
977982
platforms:
978983
- Xamarin.Android
979984
- Xamarin.iOS
@@ -993,7 +998,7 @@ supported-platforms:
993998
- .Net Core
994999
- .Net 6.0
9951000
-
996-
version: PubnubUWP 'C#' 8.0.2
1001+
version: PubnubUWP 'C#' 8.0.3
9971002
platforms:
9981003
- Windows Phone 10
9991004
- Universal Windows Apps
@@ -1017,7 +1022,7 @@ sdks:
10171022
distribution-type: source
10181023
distribution-repository: GitHub
10191024
package-name: Pubnub
1020-
location: https://github.com/pubnub/c-sharp/releases/tag/v8.0.2
1025+
location: https://github.com/pubnub/c-sharp/releases/tag/v8.0.3
10211026
requires:
10221027
-
10231028
name: ".Net"
@@ -1300,7 +1305,7 @@ sdks:
13001305
distribution-type: source
13011306
distribution-repository: GitHub
13021307
package-name: PubNubPCL
1303-
location: https://github.com/pubnub/c-sharp/releases/tag/v8.0.2
1308+
location: https://github.com/pubnub/c-sharp/releases/tag/v8.0.3
13041309
requires:
13051310
-
13061311
name: ".Net Core"
@@ -1659,7 +1664,7 @@ sdks:
16591664
distribution-type: source
16601665
distribution-repository: GitHub
16611666
package-name: PubnubUWP
1662-
location: https://github.com/pubnub/c-sharp/releases/tag/v8.0.2
1667+
location: https://github.com/pubnub/c-sharp/releases/tag/v8.0.3
16631668
requires:
16641669
-
16651670
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+
v8.0.3 - November 20 2025
2+
-----------------------------
3+
- Modified: refactor EmitStatus to prevent concurrent modification issue resulting InvalidOperationException.
4+
15
v8.0.2 - November 17 2025
26
-----------------------------
37
- Fixed: fixes issue of subscription loop breaking when a listener callback throws exception.

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,24 @@ private void MessageEmitter<T>(Pubnub pubnubInstance, PNMessageResult<T> message
229229

230230
private void StatusEmitter(Pubnub pubnubInstance, PNStatus status)
231231
{
232-
foreach (var listener in SubscribeListenerList)
232+
try
233233
{
234-
try
235-
{
236-
listener?.Status(pubnubInstance, status);
237-
}
238-
catch (Exception ex)
234+
foreach (var listener in SubscribeListenerList.ToArray())
239235
{
240-
config.Logger?.Error($"error during event handler function, {ex.Message}");
236+
try
237+
{
238+
listener?.Status(pubnubInstance, status);
239+
}
240+
catch (Exception ex)
241+
{
242+
config.Logger?.Warn($"error in status event handler function, {ex.Message}");
243+
}
241244
}
242245
}
246+
catch (Exception ex)
247+
{
248+
config.Logger?.Warn($"Emit Status encounter error: {ex.Message}");
249+
}
243250
}
244-
245251
}
246252
}

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("8.0.2")]
15-
[assembly: AssemblyFileVersion("8.0.2")]
14+
[assembly: AssemblyVersion("8.0.3")]
15+
[assembly: AssemblyFileVersion("8.0.3")]
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
@@ -14,15 +14,15 @@
1414

1515
<PropertyGroup>
1616
<PackageId>Pubnub</PackageId>
17-
<PackageVersion>8.0.2</PackageVersion>
17+
<PackageVersion>8.0.3</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>Fixes issue of subscription loop breaking when a listener callback throws exception.</PackageReleaseNotes>
25+
<PackageReleaseNotes>Refactor EmitStatus to prevent concurrent modification issue resulting InvalidOperationException.</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

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>8.0.2</PackageVersion>
17+
<PackageVersion>8.0.3</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>Fixes issue of subscription loop breaking when a listener callback throws exception.</PackageReleaseNotes>
25+
<PackageReleaseNotes>Refactor EmitStatus to prevent concurrent modification issue resulting InvalidOperationException.</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
@@ -16,15 +16,15 @@
1616

1717
<PropertyGroup>
1818
<PackageId>PubnubUWP</PackageId>
19-
<PackageVersion>8.0.2</PackageVersion>
19+
<PackageVersion>8.0.3</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>Fixes issue of subscription loop breaking when a listener callback throws exception.</PackageReleaseNotes>
27+
<PackageReleaseNotes>Refactor EmitStatus to prevent concurrent modification issue resulting InvalidOperationException.</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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<PropertyGroup>
1717
<PackageId>PubnubApiUnity</PackageId>
18-
<PackageVersion>8.0.2</PackageVersion>
18+
<PackageVersion>8.0.3</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)