Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5a390a1
Add more data validation to channel metadata tests
jakub-grzesiowski May 12, 2025
fbf8ad4
Add more detail to Metadata tests
jakub-grzesiowski May 13, 2025
18d528e
Cleanup RemoveUUIDMetadata test
jakub-grzesiowski May 14, 2025
2400347
Add unsubsribe test, improve token tests, small membership tests cleanup
jakub-grzesiowski May 14, 2025
29955ce
Add WhereNow and Signal CustomType tests
jakub-grzesiowski May 15, 2025
40b9121
Add new Set/Get/Remove/Manage Memberships integration tests
jakub-grzesiowski May 19, 2025
94ddf39
Add new test for SetPresenceState
jakub-grzesiowski May 19, 2025
63a14d8
Add new file and message count tests
jakub-grzesiowski May 20, 2025
3228399
Add delays in metadata tests
jakub-grzesiowski May 21, 2025
6887996
Add uuid pattern to TestHarness token granting for testing and tests …
jakub-grzesiowski May 21, 2025
d5b40a3
Add new integration tests + chennel group rule to TestHarness grant t…
jakub-grzesiowski May 22, 2025
18cda73
Merge branch 'master' of https://github.com/pubnub/c-sharp into test-…
jakub-grzesiowski May 26, 2025
1e06e18
Add new custom type, download file, and add listener tests
jakub-grzesiowski May 26, 2025
52d99a8
Fix access in object channel metadata tests
jakub-grzesiowski May 26, 2025
35f97d1
Update vulnerable package, remove obsolete payloadContainer from Even…
jakub-grzesiowski May 26, 2025
c063168
Add more asserts to ThenSetRemoveChannelMetadataWithSetRemoveMembersh…
jakub-grzesiowski May 27, 2025
f1e01dd
Change assertion format in ThenWithAsyncGrantTokenShouldReturnSuccess
jakub-grzesiowski May 27, 2025
31fa3fc
Small grant an sub tests tweaks
jakub-grzesiowski May 27, 2025
df78572
Test random channel id tweak
jakub-grzesiowski May 27, 2025
320bda4
PubNub SDK v7.3.12.0 release.
pubnub-release-bot May 28, 2025
092602c
Add missing delays, small stability-improving refactor of WhenSubscri…
jakub-grzesiowski May 28, 2025
a34c6b1
Add another missing delay
jakub-grzesiowski May 28, 2025
5c805ce
Improve random id generation in tests
jakub-grzesiowski May 29, 2025
25ecbce
Add another missing delay
jakub-grzesiowski May 29, 2025
a7178f4
Yet another missing delay
jakub-grzesiowski May 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: c-sharp
version: "7.3.11"
version: "7.3.12"
schema: 1
scm: github.com/pubnub/c-sharp
changelog:
- date: 2025-05-28
version: v7.3.12
changes:
- type: feature
text: "Added new integration tests to better cover all SDK endpoints."
- type: bug
text: "Fixed an issue when upon receiving a message with published with a custom type the CustomMessageType would be null upon receiving."
- date: 2025-05-20
version: v7.3.11
changes:
Expand Down Expand Up @@ -902,7 +909,7 @@ features:
- QUERY-PARAM
supported-platforms:
-
version: Pubnub 'C#' 7.3.11
version: Pubnub 'C#' 7.3.12
platforms:
- Windows 10 and up
- Windows Server 2008 and up
Expand All @@ -913,7 +920,7 @@ supported-platforms:
- .Net Framework 4.6.1+
- .Net Framework 6.0
-
version: PubnubPCL 'C#' 7.3.11
version: PubnubPCL 'C#' 7.3.12
platforms:
- Xamarin.Android
- Xamarin.iOS
Expand All @@ -933,7 +940,7 @@ supported-platforms:
- .Net Core
- .Net 6.0
-
version: PubnubUWP 'C#' 7.3.11
version: PubnubUWP 'C#' 7.3.12
platforms:
- Windows Phone 10
- Universal Windows Apps
Expand All @@ -957,7 +964,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: Pubnub
location: https://github.com/pubnub/c-sharp/releases/tag/v7.3.11.0
location: https://github.com/pubnub/c-sharp/releases/tag/v7.3.12.0
requires:
-
name: ".Net"
Expand Down Expand Up @@ -1240,7 +1247,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubNubPCL
location: https://github.com/pubnub/c-sharp/releases/tag/v7.3.11.0
location: https://github.com/pubnub/c-sharp/releases/tag/v7.3.12.0
requires:
-
name: ".Net Core"
Expand Down Expand Up @@ -1599,7 +1606,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubnubUWP
location: https://github.com/pubnub/c-sharp/releases/tag/v7.3.11.0
location: https://github.com/pubnub/c-sharp/releases/tag/v7.3.12.0
requires:
-
name: "Universal Windows Platform Development"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v7.3.12 - May 28 2025
-----------------------------
- Added: added new integration tests to better cover all SDK endpoints.

- Fixed: fixed an issue when upon receiving a message with published with a custom type the CustomMessageType would be null upon receiving.

v7.3.11 - May 20 2025
-----------------------------
- Fixed: fix missing `heartbeat` and `leave` REST API calls when the event engine is enabled and `presenceTimeout` or `presenceHeartbeatInterval` not set.
Expand Down
22 changes: 6 additions & 16 deletions src/Api/PubnubApi/EventEngine/Common/EventEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ public void EmitEvent<T>(object e)
{
payload = eventData?.Payload;
}

List<object> payloadContainer = new List<object>(); //First item always message

if (currentMessageChannel.Contains("-pnpres") || currentMessageChannel.Contains(".*-pnpres"))
{
payloadContainer.Add(payload);
jsonFields.Add("payload", payload);
}
else if (eventData.MessageType == 2) //Objects Simplification events
Expand All @@ -150,7 +148,6 @@ public void EmitEvent<T>(object e)
{
if (objectsVersion.CompareTo(2D) == 0) //Process only version=2 for Objects Simplification. Ignore 1.
{
payloadContainer.Add(payload);
jsonFields.Add("payload", payload);
}
}
Expand All @@ -172,7 +169,6 @@ public void EmitEvent<T>(object e)
}

object decodeMessage = jsonLibrary.DeserializeToObject((decryptMessage == "**DECRYPT ERROR**") ? jsonLibrary.SerializeToJsonString(payload) : decryptMessage);
payloadContainer.Add(decodeMessage);
jsonFields.Add("payload", decodeMessage);
}
else
Expand All @@ -181,33 +177,27 @@ public void EmitEvent<T>(object e)
object payloadJObject = jsonLibrary.BuildJsonObject(payloadJson);
if (payloadJObject == null)
{
payloadContainer.Add(payload);
jsonFields.Add("payload", payload);
}
else
{
payloadContainer.Add(payloadJObject);
jsonFields.Add("payload", payloadJObject);
}
}
}

var userMetaData = eventData.UserMetadata;
payloadContainer.Add(userMetaData); //Second one always user meta data
jsonFields.Add("userMetadata", userMetaData);
payloadContainer.Add(GetTimetokenMetadata(eventData.PublishMetadata).Timetoken); //Third one always Timetoken - 2
jsonFields.Add("publishTimetoken", GetTimetokenMetadata(eventData.PublishMetadata).Timetoken);
payloadContainer.Add(eventData.IssuingClientId); //Fourth one always Publisher
jsonFields.Add("userId", eventData.IssuingClientId); // - 3
jsonFields.Add("userId", eventData.IssuingClientId);

payloadContainer.Add(currentMessageChannelGroup);
payloadContainer.Add(currentMessageChannel);
jsonFields.Add("currentMessageChannelGroup", currentMessageChannelGroup);
jsonFields.Add("currentMessageChannel", currentMessageChannel);

switch (eventData.MessageType)
{
case 1:
{
payloadContainer.Add(eventData.CustomMessageType);
jsonFields.Add("customMessageType", eventData.CustomMessageType);
ResponseBuilder responseBuilder = new ResponseBuilder(configuration, jsonLibrary);
PNMessageResult<T> pnMessageResult = responseBuilder.GetEventResultObject<PNMessageResult<T>>(jsonFields);
Expand Down Expand Up @@ -308,7 +298,7 @@ public void EmitEvent<T>(object e)
}
case 4:
{
payloadContainer.Add(eventData.CustomMessageType);
jsonFields.Add("customMessageType", eventData.CustomMessageType);
ResponseBuilder responseBuilder =new ResponseBuilder(configuration, jsonLibrary);
PNMessageResult<object> filesEvent = responseBuilder.GetEventResultObject<PNMessageResult<object>>(jsonFields);
if (filesEvent != null)
Expand Down Expand Up @@ -404,7 +394,7 @@ public void EmitEvent<T>(object e)
}
else
{
payloadContainer.Add(eventData.CustomMessageType);
jsonFields.Add("customMessageType", eventData.CustomMessageType);
ResponseBuilder responseBuilder =new ResponseBuilder(configuration, jsonLibrary);
PNMessageResult<T> userMessage = responseBuilder.GetEventResultObject<PNMessageResult<T>>(jsonFields);
try
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("7.3.11.0")]
[assembly: AssemblyFileVersion("7.3.11.0")]
[assembly: AssemblyVersion("7.3.12.0")]
[assembly: AssemblyFileVersion("7.3.12.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
5 changes: 3 additions & 2 deletions src/Api/PubnubApi/PubnubApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

<PropertyGroup>
<PackageId>Pubnub</PackageId>
<PackageVersion>7.3.11.0</PackageVersion>
<PackageVersion>7.3.12.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>Fix missing `heartbeat` and `leave` REST API calls when the event engine is enabled and `presenceTimeout` or `presenceHeartbeatInterval` not set.</PackageReleaseNotes>
<PackageReleaseNotes>Fixed an issue when upon receiving a message with published with a custom type the CustomMessageType would be null upon receiving.
Added new integration tests to better cover all SDK endpoints.</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
5 changes: 3 additions & 2 deletions src/Api/PubnubApiPCL/PubnubApiPCL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

<PropertyGroup>
<PackageId>PubnubPCL</PackageId>
<PackageVersion>7.3.11.0</PackageVersion>
<PackageVersion>7.3.12.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>Fix missing `heartbeat` and `leave` REST API calls when the event engine is enabled and `presenceTimeout` or `presenceHeartbeatInterval` not set.</PackageReleaseNotes>
<PackageReleaseNotes>Fixed an issue when upon receiving a message with published with a custom type the CustomMessageType would be null upon receiving.
Added new integration tests to better cover all SDK endpoints.</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
5 changes: 3 additions & 2 deletions src/Api/PubnubApiUWP/PubnubApiUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

<PropertyGroup>
<PackageId>PubnubUWP</PackageId>
<PackageVersion>7.3.11.0</PackageVersion>
<PackageVersion>7.3.12.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>Fix missing `heartbeat` and `leave` REST API calls when the event engine is enabled and `presenceTimeout` or `presenceHeartbeatInterval` not set.</PackageReleaseNotes>
<PackageReleaseNotes>Fixed an issue when upon receiving a message with published with a custom type the CustomMessageType would be null upon receiving.
Added new integration tests to better cover all SDK endpoints.</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>7.3.11.0</PackageVersion>
<PackageVersion>7.3.12.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
Expand Down
4 changes: 2 additions & 2 deletions src/UnitTests/PubnubApi.Tests/EncryptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -995,14 +995,14 @@ public void TestSubscribeDecryptionOnNonEncryptedMessage()

pn.Subscribe<string>().Channels(new[] { "test" }).Execute();

Thread.Sleep(1000);
Thread.Sleep(2000);

CreateTestSender().Publish()
.Channel("test")
.Message("test")
.Execute(new PNPublishResultExt((r,s)=>{}));

bool passed = done.WaitOne(5000);
bool passed = done.WaitOne(6500);
Assert.True(passed);
}

Expand Down
6 changes: 6 additions & 0 deletions src/UnitTests/PubnubApi.Tests/PubnubApi.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<None Update="file_large.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy $(ProjectDir)fileupload.txt $(ProjectDir)$(OutDir)" />
<Exec Command="copy $(ProjectDir)fileupload_enc.txt $(ProjectDir)$(OutDir)" />
Expand Down
10 changes: 10 additions & 0 deletions src/UnitTests/PubnubApi.Tests/TestHarness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public static async Task GenerateTestGrantToken(Pubnub pubnub, string presenceTe
string channel4 = "hello_my_channel_4";
string group = "hello_my_group";
string channelPattern = "foo.*";
string channelGroupPattern = "foo.*";
string uuidPattern = "fuu.*";

var fullAccess = new PNTokenAuthValues()
{
Expand Down Expand Up @@ -116,6 +118,14 @@ public static async Task GenerateTestGrantToken(Pubnub pubnub, string presenceTe
{
{ channelPattern, fullAccess },
{ channelPattern+"-pnpres", fullAccess }
},
Uuids = new Dictionary<string, PNTokenAuthValues>()
{
{uuidPattern, fullAccess}
},
ChannelGroups = new Dictionary<string, PNTokenAuthValues>()
{
{channelGroupPattern, fullAccess}
}
})
.ExecuteAsync();
Expand Down
Loading
Loading