Skip to content

Commit

Permalink
RTT Feature: Change id to sequence id (#5592)
Browse files Browse the repository at this point in the history
* Change id to seqid

* Change files
  • Loading branch information
carocao-msft authored Jan 29, 2025
1 parent 357b991 commit 46692aa
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
6 changes: 3 additions & 3 deletions packages/calling-component-bindings/src/captionsSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/calling-stateful-client/src/CallClientState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/calling-stateful-client/src/CallContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/calling-stateful-client/src/Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down

0 comments on commit 46692aa

Please sign in to comment.