From ef0c0cf746cc86d593ee1cf0541f21a01f82eb4b Mon Sep 17 00:00:00 2001 From: Piotr Suwala Date: Mon, 23 Oct 2023 11:06:35 +0200 Subject: [PATCH 1/4] feat(lib): rm an unused parameter --- .../react-native-group-chat/screens/tabs/home/HomeScreen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/react-native-group-chat/screens/tabs/home/HomeScreen.tsx b/samples/react-native-group-chat/screens/tabs/home/HomeScreen.tsx index 10c76c4..91ab66e 100644 --- a/samples/react-native-group-chat/screens/tabs/home/HomeScreen.tsx +++ b/samples/react-native-group-chat/screens/tabs/home/HomeScreen.tsx @@ -72,7 +72,7 @@ export function HomeScreen({ navigation }: StackScreenProps { const disconnectFuncs = channels.map((ch) => - ch.connect((message) => { + ch.connect(() => { fetchUnreadMessagesCount() }) ) From 97b613ffd5660b914a0c7cab4399b0bf2387fd16 Mon Sep 17 00:00:00 2001 From: Piotr Suwala Date: Mon, 23 Oct 2023 11:33:47 +0200 Subject: [PATCH 2/4] feat(lib): fix a test --- lib/tests/channel.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tests/channel.test.ts b/lib/tests/channel.test.ts index e809bc9..c654953 100644 --- a/lib/tests/channel.test.ts +++ b/lib/tests/channel.test.ts @@ -282,7 +282,7 @@ describe("Channel test", () => { let { membership } = await channel.join(() => null) let unreadCount = await membership.getUnreadMessagesCount() - expect(unreadCount).toBe(false) + expect(unreadCount).toBe(0) const { messages } = await channel.getHistory() membership = await membership.setLastReadMessageTimetoken(messages[0].timetoken) From 613c9ed3fb0e97e4f25358e139e8fbc6bf95d666 Mon Sep 17 00:00:00 2001 From: Piotr Suwala Date: Mon, 23 Oct 2023 11:41:53 +0200 Subject: [PATCH 3/4] feat(lib): fix a test --- lib/tests/channel.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/tests/channel.test.ts b/lib/tests/channel.test.ts index c654953..8a3dbf3 100644 --- a/lib/tests/channel.test.ts +++ b/lib/tests/channel.test.ts @@ -637,16 +637,15 @@ describe("Channel test", () => { }) test("should correctly stream read receipts", async () => { - const randomTimetoken = "123456789123456789" - const { membership } = await channel.join(undefined, { - custom: { lastReadMessageTimetoken: randomTimetoken }, - }) - channel.disconnect() + const { membership, disconnect } = await channel.join(() => null) + disconnect() const mockCallback = jest.fn() const stopReceipts = await channel.streamReadReceipts(mockCallback) expect(mockCallback).toHaveBeenCalledTimes(1) - expect(mockCallback).toHaveBeenCalledWith({ [randomTimetoken]: ["test-user"] }) + expect(mockCallback).toHaveBeenCalledWith({ + [membership.lastReadMessageTimetoken]: ["test-user"], + }) const { timetoken } = await channel.sendText("New message") await sleep(150) // history calls have around 130ms of cache time From 80571cbeba5440f73d7691eaa19e7bf9dbf298c2 Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:16:22 +0000 Subject: [PATCH 4/4] PubNub SDK v0.2.0 release. --- .pubnub.yml | 11 ++++++++++- lib/package.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index f887117..14f02ac 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,11 +1,20 @@ --- name: pubnub-js-chat -version: v0.1.0 +version: v0.2.0 scm: github.com/pubnub/js-chat schema: 1 files: - lib/dist/index.js changelog: + - date: 2023-10-23 + version: v0.2.0 + changes: + - type: feature + text: "Add moderation restriction methods." + - type: feature + text: "Change the way unread message count is calculated." + - type: bug + text: "Removing threads." - date: 2023-09-26 version: v0.1.0 changes: diff --git a/lib/package.json b/lib/package.json index c95bde8..bab88a6 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@pubnub/chat", - "version": "0.1.0", + "version": "0.2.0", "description": "PubNub JavaScript Chat SDK", "author": "PubNub ", "license": "MIT",