Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
version: v1.1.0
version: v1.1.1
changelog:
- date: 2025-11-06
version: v1.1.1
changes:
- type: feature
text: "Updated Unity SDK dependency to latest version - 9.3.0."
- type: bug
text: "Fixed an issue where sometimes the Active status for User would not have expected value."
- date: 2025-10-29
version: v1.1.0
changes:
Expand Down
26 changes: 13 additions & 13 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ChannelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public async Task TestLeaveChannel()
Assert.IsNotNull(currentChatUser, "currentChatUser was null");

var channel = TestUtils.AssertOperation(await chat.CreatePublicConversation());
channel.Join();
await channel.Join();

await Task.Delay(3000);

Expand All @@ -144,7 +144,7 @@ public async Task TestGetMessagesHistory()
{
TestUtils.AssertOperation(await message.EditMessageText("some_new_text"));
};
channel.Join();
await channel.Join();
await Task.Delay(3500);
TestUtils.AssertOperation(await channel.SendText("wololo"));

Expand All @@ -163,7 +163,7 @@ public async Task TestGetMessagesHistory()
public async Task TestGetMemberships()
{
var channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("get_members_test_channel"));
channel.Join();
await channel.Join();
await Task.Delay(3500);
var memberships = TestUtils.AssertOperation(await channel.GetMemberships());
Assert.That(memberships.Memberships.Count, Is.GreaterThanOrEqualTo(1));
Expand All @@ -173,7 +173,7 @@ public async Task TestGetMemberships()
public async Task TestStartTyping()
{
var channel = TestUtils.AssertOperation(await chat.CreateDirectConversation(talkUser, "sttc")).CreatedChannel;
channel.Join();
await channel.Join();
await Task.Delay(2500);
channel.SetListeningForTyping(true);

Expand All @@ -195,7 +195,7 @@ public async Task TestStartTyping()
public async Task TestStopTyping()
{
var channel = TestUtils.AssertOperation(await chat.CreateDirectConversation(talkUser, "stop_typing_test_channel")).CreatedChannel;
channel.Join();
await channel.Join();
await Task.Delay(2500);
channel.SetListeningForTyping(true);
await Task.Delay(2500);
Expand All @@ -220,7 +220,7 @@ public async Task TestStopTyping()
public async Task TestStopTypingFromTimer()
{
var channel = TestUtils.AssertOperation(await chat.CreateDirectConversation(talkUser, "stop_typing_timeout_test_channel")).CreatedChannel;
channel.Join();
await channel.Join();
await Task.Delay(2500);
channel.SetListeningForTyping(true);

Expand All @@ -245,7 +245,7 @@ public async Task TestStopTypingFromTimer()
public async Task TestPinMessage()
{
var channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("pin_message_test_channel_37"));
channel.Join();
await channel.Join();
await Task.Delay(3500);

var receivedManualEvent = new ManualResetEvent(false);
Expand Down Expand Up @@ -273,7 +273,7 @@ public async Task TestPinMessage()
public async Task TestUnPinMessage()
{
var channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("unpin_message_test_channel"));
channel.Join();
await channel.Join();
await Task.Delay(3500);
var receivedManualEvent = new ManualResetEvent(false);
channel.OnMessageReceived += async message =>
Expand Down Expand Up @@ -317,7 +317,7 @@ public async Task TestCreateMessageDraft()
public async Task TestEmitUserMention()
{
var channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("user_mention_test_channel"));
channel.Join();
await channel.Join();
await Task.Delay(2500);
var receivedManualEvent = new ManualResetEvent(false);
user.SetListeningForMentionEvents(true);
Expand All @@ -336,7 +336,7 @@ public async Task TestEmitUserMention()
public async Task TestChannelIsPresent()
{
var someChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation());
someChannel.Join();
await someChannel.Join();

await Task.Delay(4000);

Expand All @@ -349,7 +349,7 @@ public async Task TestChannelIsPresent()
public async Task TestChannelWhoIsPresent()
{
var someChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation());
someChannel.Join();
await someChannel.Join();

await Task.Delay(4000);

Expand All @@ -370,7 +370,7 @@ public async Task TestPresenceCallback()
Assert.True(userIds.Contains(user.Id), "presence callback doesn't contain joined user id");
reset.Set();
};
someChannel.Join();
await someChannel.Join();
var presenceReceived = reset.WaitOne(12000);

Assert.True(presenceReceived, "did not receive presence callback");
Expand All @@ -389,7 +389,7 @@ public async Task TestReportCallback()
reset.Set();
};

someChannel.Join();
await someChannel.Join();
await Task.Delay(3000);

someChannel.OnMessageReceived += async message =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task Setup()
}));
channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("event_tests_channel"));
user = TestUtils.AssertOperation(await chat.GetCurrentUser());
channel.Join();
await channel.Join();
await Task.Delay(3500);
}

Expand Down
25 changes: 13 additions & 12 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ChatTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public async Task Setup()
}));
channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("chat_tests_channel_2"));
currentUser = TestUtils.AssertOperation(await chat.GetCurrentUser());
channel.Join();
await channel.Join();
await Task.Delay(3500);
}

[TearDown]
public async Task CleanUp()
{
channel.Leave();
await channel.Leave();
await Task.Delay(1000);
chat.Destroy();
await Task.Delay(1000);
Expand Down Expand Up @@ -140,7 +140,7 @@ public async Task TestForwardMessage()
Assert.True(message.MessageText == "message_to_forward");
messageForwardReceivedManualEvent.Set();
};
forwardingChannel.Join();
await forwardingChannel.Join();
await Task.Delay(2500);

channel.OnMessageReceived += async message => { await message.Forward(forwardingChannel.Id); };
Expand Down Expand Up @@ -192,23 +192,24 @@ public async Task TestGetUnreadMessagesCounts()
public async Task TestMarkAllMessagesAsRead()
{
var markTestChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation());
markTestChannel.Join();
await markTestChannel.Join();

await Task.Delay(3000);
await Task.Delay(4000);

await markTestChannel.SendText("wololo", new SendTextParams(){StoreInHistory = true});

await Task.Delay(3000);
await Task.Delay(4000);

Assert.True(TestUtils.AssertOperation(await chat.GetUnreadMessagesCounts()).Any(x => x.ChannelId == markTestChannel.Id && x.Count > 0));
var unread = TestUtils.AssertOperation(await chat.GetUnreadMessagesCounts(filter:$"channel.id LIKE \"{markTestChannel.Id}\""));
Assert.True(unread.Any(x => x.ChannelId == markTestChannel.Id && x.Count > 0));

TestUtils.AssertOperation(await chat.MarkAllMessagesAsRead());
TestUtils.AssertOperation(await chat.MarkAllMessagesAsRead(filter:$"channel.id LIKE \"{markTestChannel.Id}\""));

await Task.Delay(5000);
await Task.Delay(7000);

var counts = TestUtils.AssertOperation(await chat.GetUnreadMessagesCounts());

markTestChannel.Leave();
await markTestChannel.Leave();
await markTestChannel.Delete(false);

Assert.False(counts.Any(x => x.ChannelId == markTestChannel.Id && x.Count > 0));
Expand All @@ -224,7 +225,7 @@ public async Task TestReadReceipts()
}));
var otherChatChannel = TestUtils.AssertOperation(await otherChat.GetChannel(channel.Id));

otherChatChannel.Join();
await otherChatChannel.Join();
await Task.Delay(2500);
otherChatChannel.SetListeningForReadReceiptsEvents(true);
await Task.Delay(2500);
Expand All @@ -243,7 +244,7 @@ public async Task TestReadReceipts()

await Task.Delay(5000);

await chat.MarkAllMessagesAsRead();
await chat.MarkAllMessagesAsRead(filter:$"channel.id LIKE \"{channel.Id}\"");
var receipt = receiptReset.WaitOne(15000);
Assert.True(receipt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task Setup()
}));
channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("membership_tests_channel"));
user = TestUtils.AssertOperation(await chat.GetCurrentUser());
channel.Join();
await channel.Join();
await Task.Delay(3500);
}

Expand Down Expand Up @@ -112,7 +112,7 @@ public async Task TestInviteMultiple()
public async Task TestLastRead()
{
var testChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation("last_read_test_channel_57"));
testChannel.Join();
await testChannel.Join();

await Task.Delay(4000);

Expand Down Expand Up @@ -151,7 +151,7 @@ public async Task TestLastRead()
public async Task TestUnreadMessagesCount()
{
var unreadChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation($"test_channel_{Guid.NewGuid()}"));
unreadChannel.Join();
await unreadChannel.Join();

await Task.Delay(3500);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task Setup()
{
Name = "MessageDraftTestingChannel"
}));
channel.Join();
await channel.Join();
await Task.Delay(3000);

dummyUser = await chat.GetOrCreateUser("mock_user", new ChatUserData()
Expand Down
11 changes: 7 additions & 4 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MessageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task Setup()
}));
channel = TestUtils.AssertOperation(await chat.CreatePublicConversation("message_tests_channel_2"));
user = TestUtils.AssertOperation(await chat.GetCurrentUser());
channel.Join();
await channel.Join();
await Task.Delay(3500);
}

Expand Down Expand Up @@ -55,7 +55,7 @@ public async Task TestReceivingMessageData()
{
var manualReceiveEvent = new ManualResetEvent(false);
var testChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation("message_data_test_channel"));
testChannel.Join();
await testChannel.Join();
await Task.Delay(2500);
testChannel.OnMessageReceived += async message =>
{
Expand Down Expand Up @@ -83,6 +83,9 @@ public async Task TestReceivingMessageData()

var received = manualReceiveEvent.WaitOne(9000);
Assert.IsTrue(received);

//Cleanup
await testChannel.Delete();
}

[Test]
Expand Down Expand Up @@ -202,7 +205,7 @@ public async Task TestRestoreMessage()
public async Task TestPinMessage()
{
var pinTestChannel = TestUtils.AssertOperation(await chat.CreatePublicConversation());
pinTestChannel.Join();
await pinTestChannel.Join();
await Task.Delay(2500);
pinTestChannel.SetListeningForUpdates(true);
await Task.Delay(3000);
Expand Down Expand Up @@ -274,7 +277,7 @@ public async Task TestCreateThread()
{
message.SetListeningForUpdates(true);
var thread = TestUtils.AssertOperation(message.CreateThread());
thread.Join();
await thread.Join();
await Task.Delay(3500);
await thread.SendText("thread_init_text");
await Task.Delay(5000);
Expand Down
12 changes: 6 additions & 6 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ThreadsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task Setup()
var randomId = Guid.NewGuid().ToString()[..10];
channel = TestUtils.AssertOperation(await chat.CreatePublicConversation(randomId));
user = TestUtils.AssertOperation(await chat.GetCurrentUser());
channel.Join();
await channel.Join();
await Task.Delay(3500);
}

Expand All @@ -45,7 +45,7 @@ public async Task TestGetThreadHistory()
{
message.SetListeningForUpdates(true);
var thread = TestUtils.AssertOperation(message.CreateThread());
thread.Join();
await thread.Join();

await Task.Delay(5000);

Expand All @@ -72,7 +72,7 @@ public async Task TestThreadChannelParentChannelPinning()
{
message.SetListeningForUpdates(true);
var thread = TestUtils.AssertOperation(message.CreateThread());
thread.Join();
await thread.Join();
await thread.SendText("thread init message");

await Task.Delay(7000);
Expand Down Expand Up @@ -105,7 +105,7 @@ public async Task TestThreadChannelEmitUserMention()
channel.OnMessageReceived += async message =>
{
var thread = TestUtils.AssertOperation(message.CreateThread());
thread.Join();
await thread.Join();
await Task.Delay(2500);
user.SetListeningForMentionEvents(true);
await Task.Delay(2500);
Expand All @@ -129,7 +129,7 @@ public async Task TestThreadMessageParentChannelPinning()
{
message.SetListeningForUpdates(true);
var thread = TestUtils.AssertOperation(message.CreateThread());
thread.Join();
await thread.Join();

await Task.Delay(3500);

Expand Down Expand Up @@ -169,7 +169,7 @@ public async Task TestThreadMessageUpdate()
{
message.SetListeningForUpdates(true);
var thread = TestUtils.AssertOperation(message.CreateThread());
thread.Join();
await thread.Join();

await Task.Delay(3000);

Expand Down
Loading