diff --git a/change-beta/@azure-communication-react-19209e7d-098c-4cfc-b0e5-40636320691b.json b/change-beta/@azure-communication-react-19209e7d-098c-4cfc-b0e5-40636320691b.json new file mode 100644 index 00000000000..973dcfabeda --- /dev/null +++ b/change-beta/@azure-communication-react-19209e7d-098c-4cfc-b0e5-40636320691b.json @@ -0,0 +1,9 @@ +{ + "type": "prerelease", + "area": "feature", + "workstream": "RTT", + "comment": "Change id to sequenceId for RTT feature state", + "packageName": "@azure/communication-react", + "email": "96077406+carocao-msft@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/calling-component-bindings/src/captionsSelector.ts b/packages/calling-component-bindings/src/captionsSelector.ts index c7519e78fc2..89dd06f6daa 100644 --- a/packages/calling-component-bindings/src/captionsSelector.ts +++ b/packages/calling-component-bindings/src/captionsSelector.ts @@ -179,7 +179,7 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel .map((rtt) => { const userId = getRealTimeTextSpeakerIdentifier(rtt); return { - id: rtt.id, + id: rtt.sequenceId, displayName: getRealTimeTextDisplayName(rtt, identifier, remoteParticipants, displayName, userId), message: rtt.message, userId, @@ -194,7 +194,7 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel .map((rtt) => { const userId = getRealTimeTextSpeakerIdentifier(rtt); return { - id: rtt.id, + id: rtt.sequenceId, displayName: getRealTimeTextDisplayName(rtt, identifier, remoteParticipants, displayName, userId), message: rtt.message, userId, @@ -207,7 +207,7 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel const myInProgress = realTimeTexts?.myInProgress && realTimeTexts.myInProgress.message !== '' ? { - id: realTimeTexts.myInProgress.id, + id: realTimeTexts.myInProgress.sequenceId, displayName: displayName, message: realTimeTexts.myInProgress.message, userId: identifier, diff --git a/packages/calling-stateful-client/src/CallClientState.ts b/packages/calling-stateful-client/src/CallClientState.ts index 68d9a1b0a78..d067d33f64e 100644 --- a/packages/calling-stateful-client/src/CallClientState.ts +++ b/packages/calling-stateful-client/src/CallClientState.ts @@ -106,7 +106,7 @@ export interface RealTimeTextInfo { /** * The sequence id of the real time text. */ - id: number; + sequenceId: number; /** * The sender of the real time text. */ diff --git a/packages/calling-stateful-client/src/CallContext.ts b/packages/calling-stateful-client/src/CallContext.ts index 456e2d2e622..95221f58c32 100644 --- a/packages/calling-stateful-client/src/CallContext.ts +++ b/packages/calling-stateful-client/src/CallContext.ts @@ -1200,7 +1200,7 @@ export class CallContext { realTimeTexts.myInProgress = undefined; } else { realTimeTexts.currentInProgress = realTimeTexts.currentInProgress?.filter( - (message) => message.id !== newRealTimeText.id + (message) => message.sequenceId !== newRealTimeText.sequenceId ); } } else { @@ -1219,7 +1219,7 @@ export class CallContext { // find the index of the existing in progress message // replace the existing in progress message with the new one const existingIndex = realTimeTexts.currentInProgress?.findIndex( - (message) => message.id === newRealTimeText.id + (message) => message.sequenceId === newRealTimeText.sequenceId ); if (existingIndex === -1) { realTimeTexts.currentInProgress?.push(newRealTimeText); diff --git a/packages/calling-stateful-client/src/Converter.ts b/packages/calling-stateful-client/src/Converter.ts index 8439771669b..1314b5bd566 100644 --- a/packages/calling-stateful-client/src/Converter.ts +++ b/packages/calling-stateful-client/src/Converter.ts @@ -285,7 +285,6 @@ export function convertFromSDKToCaptionInfoState(caption: AcsCaptionsInfo): Capt */ export function convertFromSDKRealTimeTextToRealTimeTextInfoState(realTimeText: ACSRealTimeTextInfo): RealTimeTextInfo { return { - id: realTimeText.sequenceId, message: realTimeText.text, isMe: realTimeText.isLocal, ...realTimeText diff --git a/packages/communication-react/review/beta/communication-react.api.md b/packages/communication-react/review/beta/communication-react.api.md index c54f9e4f19f..7755fb41256 100644 --- a/packages/communication-react/review/beta/communication-react.api.md +++ b/packages/communication-react/review/beta/communication-react.api.md @@ -4633,12 +4633,12 @@ export interface RealTimeTextCallFeatureState { // @beta (undocumented) export interface RealTimeTextInfo { - id: number; isMe?: boolean; message: string; receivedTimestamp?: Date; resultType: RealTimeTextResultType; sender: ParticipantInfo; + sequenceId: number; updatedTimestamp?: Date; } diff --git a/packages/react-components/src/components/CaptionsBanner.tsx b/packages/react-components/src/components/CaptionsBanner.tsx index 7471e71d0de..52fbec4a93d 100644 --- a/packages/react-components/src/components/CaptionsBanner.tsx +++ b/packages/react-components/src/components/CaptionsBanner.tsx @@ -69,7 +69,7 @@ export type CaptionsInformation = { */ export type RealTimeTextInformation = { /** - * The sequence id of the real time text. + * The id of the real time text. */ id: number; /**