Skip to content

Commit 19d8dca

Browse files
authored
[Chat][Bugfix] Update error message for unsupported chat thread type (#2907)
1 parent 6ad3d84 commit 19d8dca

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update error message for unsupported chat thread types",
4+
"packageName": "@azure/communication-react",
5+
"email": "77021369+jimchou-dev@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update error message for unsupported chat thread types",
4+
"packageName": "@azure/communication-react",
5+
"email": "77021369+jimchou-dev@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4+
import { UNSUPPORTED_CHAT_THREAD_TYPE, TEAMS_LIMITATION_LEARN_MORE } from '../../common/constants';
45
/**
56
* Get chat thread from a teams url.
67
* As per documented on the Chat SDK: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/chat/meeting-interop?pivots=platform-web#get-a-teams-meeting-chat-thread-for-a-communication-services-user
@@ -14,8 +15,10 @@ export const getChatThreadFromTeamsLink = (teamsMeetingLink: string): string =>
1415
threadId = decodeURIComponent(threadId);
1516
// Extract just the chat guid from the link, stripping away the call locator ID
1617
threadId = threadId.split(/^(.*?@thread\.v2)/gm)[1];
17-
1818
if (!threadId || threadId.length === 0) {
19+
if (UNSUPPORTED_CHAT_THREAD_TYPE.some((t) => teamsMeetingLink.includes(t))) {
20+
throw new Error(`Teams Channel Meetings are not currently supported, read more ${TEAMS_LIMITATION_LEARN_MORE}`);
21+
}
1922
throw new Error('Could not get chat thread from teams link');
2023
}
2124

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
/**
5+
* @private
6+
*/
7+
export const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
8+
9+
/**
10+
* @private
11+
*/
12+
export const TEAMS_LIMITATION_LEARN_MORE =
13+
'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';

0 commit comments

Comments
 (0)