diff --git a/package.json b/package.json index 129b9efd..3c582f5c 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "yargs": "^17.7.2" }, "dependencies": { - "@superviz/socket-client": "1.4.0", + "@superviz/socket-client": "1.5.1", "ably": "^1.2.45", "bowser": "^2.11.0", "bowser-jr": "^1.0.6", diff --git a/src/components/realtime/channel.ts b/src/components/realtime/channel.ts index 038527fd..a60f88d7 100644 --- a/src/components/realtime/channel.ts +++ b/src/components/realtime/channel.ts @@ -133,7 +133,7 @@ export class Channel extends Observable { this.logger.log('message received', event); this.publishEventToClient(event.data.name, { data: event.data.payload, - participantId: event.presence.id, + participantId: event?.presence?.id || null, name: event.data.name, timestamp: event.timestamp, } as RealtimeMessage); diff --git a/src/components/realtime/types.ts b/src/components/realtime/types.ts index d0ce95a0..e755ff6f 100644 --- a/src/components/realtime/types.ts +++ b/src/components/realtime/types.ts @@ -25,7 +25,7 @@ export type RealtimeData = { export type RealtimeMessage = { name: string; connectionId: string; - participantId: string; + participantId: string | null; data: unknown; timestamp: number; }; diff --git a/src/core/index.ts b/src/core/index.ts index 77893f99..1fd25576 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -141,7 +141,7 @@ const init = async (apiKey: string, options: SuperVizSdkOptions): Promise