diff --git a/packages/client/src/Call.ts b/packages/client/src/Call.ts index 92ac8c5a67..4a78bcfbc8 100644 --- a/packages/client/src/Call.ts +++ b/packages/client/src/Call.ts @@ -2436,9 +2436,8 @@ export class Call { UpdateCallRequest >(`${this.streamClientBasePath}`, updates); - const { call, members, own_capabilities } = response; + const { call, own_capabilities } = response; this.state.updateFromCallResponse(call); - this.state.setMembers(members); this.state.setOwnCapabilities(own_capabilities); return response; diff --git a/packages/client/src/__tests__/Call.test.ts b/packages/client/src/__tests__/Call.test.ts index 142a293003..1d0c622cf6 100644 --- a/packages/client/src/__tests__/Call.test.ts +++ b/packages/client/src/__tests__/Call.test.ts @@ -195,6 +195,23 @@ describe('state updates in reponse to coordinator API', () => { expect(call.state.members[0].role).toBe('admin'); }); + it('should not clear members when updating custom data', async () => { + await call.getOrCreate({ + data: { + members: [{ user_id: 'sara' }, { user_id: 'jane' }], + }, + }); + + expect(call.state.members.length).toBe(2); + + await call.update({ + custom: { messageId: 'test-message-id' }, + }); + + expect(call.state.members.length).toBe(2); + expect(call.state.custom.messageId).toBe('test-message-id'); + }); + it('should get and update state', async () => { await serverClient.video.call(call.type, call.id).create({ data: { diff --git a/sample-apps/react/react-dogfood/helpers/client.ts b/sample-apps/react/react-dogfood/helpers/client.ts index 9c9a4740be..d15464256e 100644 --- a/sample-apps/react/react-dogfood/helpers/client.ts +++ b/sample-apps/react/react-dogfood/helpers/client.ts @@ -83,7 +83,7 @@ export const createTokenProvider = ( const params = new URLSearchParams({ user_id: userId || '!anon', environment, - exp: String(4 * 60 * 60), // 4 hours + exp: String(60), // 4 hours } satisfies CreateJwtTokenRequest); const res = await fetch(`${basePath}/api/auth/create-token?${params}`); diff --git a/sample-apps/react/react-dogfood/helpers/jwt.ts b/sample-apps/react/react-dogfood/helpers/jwt.ts index c8a33af41f..bddfe089f8 100644 --- a/sample-apps/react/react-dogfood/helpers/jwt.ts +++ b/sample-apps/react/react-dogfood/helpers/jwt.ts @@ -5,8 +5,7 @@ import { decodeBase64 } from 'stream-chat'; * The maximum validity of a token, in seconds. * Defaults to 7 days. */ -export const maxTokenValidityInSeconds: number = - Number(process.env.MAX_TOKEN_EXP_IN_SECONDS) || 7 * 24 * 60 * 60; // 7 days +export const maxTokenValidityInSeconds: number = 60; export const createToken = async ( userId: string,