Skip to content

Commit

Permalink
feat: group chat
Browse files Browse the repository at this point in the history
this version bump gives all new group chat functionality

BREAKING CHANGE: This commit introduces several breaking changes potentially for creating group chats.
  • Loading branch information
nplasterer committed Jul 10, 2024
1 parent 8519e52 commit b8b3d51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion example/src/tests/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ function test(name: string, perform: () => Promise<boolean>) {
}

test('can make a client', async () => {
const [client] = await createClients(1)
const client = await Client.createRandom({
env: 'local',
})

client.register(new RemoteAttachmentCodec())
if (Object.keys(client.codecRegistry).length !== 2) {
Expand Down
15 changes: 9 additions & 6 deletions src/lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ export class Client<
options: ClientOptions & { codecs?: ContentCodecs }
): Promise<Client<ContentCodecs>> {
if (
options.dbEncryptionKey === undefined ||
options.dbEncryptionKey.length !== 32
options.enableV3 === true &&
(options.dbEncryptionKey === undefined ||
options.dbEncryptionKey.length !== 32)
) {
throw new Error('Must pass an encryption key that is exactly 32 bytes.')
}
Expand Down Expand Up @@ -159,8 +160,9 @@ export class Client<
options: ClientOptions & { codecs?: ContentTypes }
): Promise<Client<ContentTypes>> {
if (
options.dbEncryptionKey === undefined ||
options.dbEncryptionKey.length !== 32
options.enableV3 === true &&
(options.dbEncryptionKey === undefined ||
options.dbEncryptionKey.length !== 32)
) {
throw new Error('Must pass an encryption key that is exactly 32 bytes.')
}
Expand Down Expand Up @@ -204,8 +206,9 @@ export class Client<
options: ClientOptions & { codecs?: ContentCodecs }
): Promise<Client<ContentCodecs>> {
if (
options.dbEncryptionKey === undefined ||
options.dbEncryptionKey.length !== 32
options.enableV3 === true &&
(options.dbEncryptionKey === undefined ||
options.dbEncryptionKey.length !== 32)
) {
throw new Error('Must pass an encryption key that is exactly 32 bytes.')
}
Expand Down

0 comments on commit b8b3d51

Please sign in to comment.