From 2d49da78897764f2901039d6324b4457d3ffeb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 1 Mar 2026 15:45:32 -0500 Subject: [PATCH] fix: #14032, fix regression in room creation add test --- src/messaging/rooms.js | 2 +- test/messaging.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js index 83de1c07c7..4356775a47 100644 --- a/src/messaging/rooms.js +++ b/src/messaging/rooms.js @@ -110,7 +110,7 @@ module.exports = function (Messaging) { [`chat:room:${roomId}:uids:online`, now, uid], ...( isPublic ? - [`chat:room:${roomId}:owners`, now, uid] : + [[`chat:room:${roomId}:owners`, now, uid]] : [uid].concat(data.uids).map(uid => ([`chat:room:${roomId}:owners`, now, uid])) ), ]), diff --git a/test/messaging.js b/test/messaging.js index 4e2e709007..bbe310e27d 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -599,6 +599,20 @@ describe('Messaging Library', () => { const { roomId } = await api.users.getPrivateRoomId({ uid: mocks.users.foo.uid }, { uid: mocks.users.herp.uid }); assert(roomId); }); + + it('should create a public chat room', async () => { + const data = await api.chats.create({ + uid: mocks.users.foo.uid, + session: {}, + }, { + name: 'public room', + type: 'public', + uids: [], + groups: ['registered-users'], + }); + assert(data.roomId); + assert.strictEqual(data.public, true); + }); }); describe('toMid', () => {