agora-appbuilder-core 4.0.29-beta-23 → 4.0.29-beta-24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +2 -2
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +7 -7
- package/template/customization-api/utils.ts +0 -1
- package/template/defaultConfig.js +2 -2
- package/template/src/auth/AuthProvider.tsx +7 -0
- package/template/src/auth/useIDPAuth.electron.tsx +1 -0
- package/template/src/auth/useIDPAuth.native.tsx +1 -0
- package/template/src/auth/useIDPAuth.tsx +1 -0
- package/template/src/auth/useTokenAuth.tsx +2 -0
- package/template/src/components/ChatContext.ts +1 -1
- package/template/src/components/EventsConfigure.tsx +38 -9
- package/template/src/components/RTMConfigure.tsx +3 -0
- package/template/src/components/common/Error.tsx +17 -3
- package/template/src/components/popups/InvitePopup.tsx +16 -0
- package/template/src/components/useUserPreference.tsx +15 -0
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +3 -0
- package/template/src/components/whiteboard/WhiteboardWidget.tsx +1 -0
- package/template/src/pages/Create.tsx +9 -0
- package/template/src/pages/Join.tsx +15 -0
- package/template/src/pages/VideoCall.tsx +35 -0
- package/template/src/subComponents/caption/useSTTAPI.tsx +1 -0
- package/template/src/subComponents/recording/useRecording.tsx +16 -1
- package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +93 -9
- package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +1 -0
- package/template/src/utils/common.tsx +0 -6
- package/template/src/utils/useCreateRoom.ts +14 -1
- package/template/src/utils/useGetMeetingPhrase.ts +8 -0
- package/template/src/utils/useJoinRoom.ts +9 -0
- package/template/src/utils/useMutePSTN.ts +14 -1
package/package.json
CHANGED
|
@@ -194,9 +194,9 @@ const Create = ({
|
|
|
194
194
|
mode === ChannelProfileType.ChannelProfileLiveBroadcasting &&
|
|
195
195
|
rtcProps?.role === ClientRoleType.ClientRoleAudience
|
|
196
196
|
) {
|
|
197
|
-
enableVideoAndAudioWithDisabledState();
|
|
197
|
+
await enableVideoAndAudioWithDisabledState();
|
|
198
198
|
} else {
|
|
199
|
-
enableVideoAndAudioWithEnabledState();
|
|
199
|
+
await enableVideoAndAudioWithEnabledState();
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
202
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {useEffect, useContext, useRef} from 'react';
|
|
1
|
+
import React, {useEffect, useContext, useRef, useState} from 'react';
|
|
2
2
|
import {IRtcEngine} from 'react-native-agora';
|
|
3
3
|
import {ContentStateInterface} from '../Contexts/RtcContext';
|
|
4
4
|
import {DispatchType} from '../Contexts/DispatchContext';
|
|
@@ -14,7 +14,7 @@ const Join: React.FC<{
|
|
|
14
14
|
tracksReady: boolean;
|
|
15
15
|
preventJoin?: boolean;
|
|
16
16
|
}> = ({children, precall, engineRef, uidState, dispatch, tracksReady}) => {
|
|
17
|
-
|
|
17
|
+
const [joinState, setJoinState] = useState(false);
|
|
18
18
|
const {rtcProps} = useContext(PropsContext);
|
|
19
19
|
|
|
20
20
|
const audioRoom = rtcProps?.audioRoom || false;
|
|
@@ -24,12 +24,12 @@ const Join: React.FC<{
|
|
|
24
24
|
// : null;
|
|
25
25
|
|
|
26
26
|
useEffect(() => {
|
|
27
|
-
if (joinState
|
|
27
|
+
if (joinState && tracksReady && Platform.OS === 'web') {
|
|
28
28
|
//@ts-ignore
|
|
29
29
|
engineRef.current.publish();
|
|
30
30
|
}
|
|
31
31
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
-
}, [tracksReady]);
|
|
32
|
+
}, [tracksReady, joinState]);
|
|
33
33
|
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
if (rtcProps?.preventJoin) {
|
|
@@ -41,7 +41,7 @@ const Join: React.FC<{
|
|
|
41
41
|
try {
|
|
42
42
|
console.log('Leaving channel');
|
|
43
43
|
engine.leaveChannel();
|
|
44
|
-
|
|
44
|
+
setJoinState(false);
|
|
45
45
|
} catch (err) {
|
|
46
46
|
console.error('Cannot leave the channel:', err);
|
|
47
47
|
}
|
|
@@ -118,9 +118,9 @@ const Join: React.FC<{
|
|
|
118
118
|
}
|
|
119
119
|
async function init() {
|
|
120
120
|
if (!precall) {
|
|
121
|
-
if (!joinState
|
|
121
|
+
if (!joinState) {
|
|
122
122
|
await join();
|
|
123
|
-
|
|
123
|
+
setJoinState(true);
|
|
124
124
|
} else {
|
|
125
125
|
await leave();
|
|
126
126
|
await join();
|
|
@@ -43,7 +43,6 @@ export {useString} from '../src/utils/useString';
|
|
|
43
43
|
export type {LanguageType} from '../src/subComponents/caption/utils';
|
|
44
44
|
export {default as useSpeechToText} from '../src/utils/useSpeechToText';
|
|
45
45
|
export {isMobileUA} from '../src/utils/common';
|
|
46
|
-
export {getSessionId} from '../src/utils/common';
|
|
47
46
|
export {default as ThemeConfig} from '../src/theme';
|
|
48
47
|
export {default as hexadecimalTransparency} from '../src/utils/hexadecimalTransparency';
|
|
49
48
|
export {useFullScreen} from '../src/utils/useFullScreen';
|
|
@@ -76,8 +76,8 @@ const DefaultConfig = {
|
|
|
76
76
|
CHAT_ORG_NAME: '',
|
|
77
77
|
CHAT_APP_NAME: '',
|
|
78
78
|
CHAT_URL: '',
|
|
79
|
-
CLI_VERSION: '3.0.
|
|
80
|
-
CORE_VERSION: '4.0.
|
|
79
|
+
CLI_VERSION: '3.0.29-beta-24',
|
|
80
|
+
CORE_VERSION: '4.0.29-beta-24',
|
|
81
81
|
DISABLE_LANDSCAPE_MODE: false,
|
|
82
82
|
STT_AUTO_START: false,
|
|
83
83
|
CLOUD_RECORDING_AUTO_START: false,
|
|
@@ -309,6 +309,7 @@ const AuthProvider = (props: AuthProviderProps) => {
|
|
|
309
309
|
context: {
|
|
310
310
|
headers: {
|
|
311
311
|
'X-Request-Id': requestId,
|
|
312
|
+
'X-Session-Id': logger.getSessionId(),
|
|
312
313
|
},
|
|
313
314
|
},
|
|
314
315
|
});
|
|
@@ -332,6 +333,11 @@ const AuthProvider = (props: AuthProviderProps) => {
|
|
|
332
333
|
'user_details',
|
|
333
334
|
'API user details query failed. User is un-authenticated. Will Login in the user',
|
|
334
335
|
{
|
|
336
|
+
networkError: {
|
|
337
|
+
name: error?.networkError?.name,
|
|
338
|
+
code: error?.networkError?.result?.error?.code,
|
|
339
|
+
message: error?.networkError?.result?.error?.message,
|
|
340
|
+
},
|
|
335
341
|
error,
|
|
336
342
|
startReqTs,
|
|
337
343
|
endRequestTs,
|
|
@@ -522,6 +528,7 @@ const AuthProvider = (props: AuthProviderProps) => {
|
|
|
522
528
|
credentials: 'include',
|
|
523
529
|
headers: {
|
|
524
530
|
'X-Request-Id': requestId,
|
|
531
|
+
'X-Session-Id': logger.getSessionId(),
|
|
525
532
|
},
|
|
526
533
|
})
|
|
527
534
|
.then(response => response.json())
|
|
@@ -57,6 +57,7 @@ const useTokenAuth = () => {
|
|
|
57
57
|
authorization: store?.token ? `Bearer ${store.token}` : '',
|
|
58
58
|
'X-Platform-ID': getPlatformId(),
|
|
59
59
|
'X-Request-Id': requestId,
|
|
60
|
+
'X-Session-Id': logger.getSessionId(),
|
|
60
61
|
},
|
|
61
62
|
})
|
|
62
63
|
.then(response => response.json())
|
|
@@ -213,6 +214,7 @@ const useTokenAuth = () => {
|
|
|
213
214
|
? `Bearer ${tokenRef.current}`
|
|
214
215
|
: '',
|
|
215
216
|
'X-Request-Id': requestId,
|
|
217
|
+
'X-Session-Id': logger.getSessionId(),
|
|
216
218
|
},
|
|
217
219
|
},
|
|
218
220
|
)
|
|
@@ -16,7 +16,6 @@ import {createContext, SetStateAction} from 'react';
|
|
|
16
16
|
import {ChatMessageType, Reaction} from './chat-messages/useChatMessages';
|
|
17
17
|
import {createHook} from 'customization-implementation';
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
export interface ChatBubbleProps {
|
|
21
20
|
isLocal: boolean;
|
|
22
21
|
message: string;
|
|
@@ -67,6 +66,7 @@ export enum messageActionType {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
export interface RtmContextInterface {
|
|
69
|
+
isInitialQueueCompleted: boolean;
|
|
70
70
|
hasUserJoinedRTM: boolean;
|
|
71
71
|
rtmInitTimstamp: number;
|
|
72
72
|
engine: RtmEngine;
|
|
@@ -58,9 +58,17 @@ import {logger, LogSource} from '../logger/AppBuilderLogger';
|
|
|
58
58
|
interface Props {
|
|
59
59
|
children: React.ReactNode;
|
|
60
60
|
callActive: boolean;
|
|
61
|
+
sttAutoStarted: boolean;
|
|
62
|
+
setSttAutoStarted: React.Dispatch<React.SetStateAction<boolean>>;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
const EventsConfigure: React.FC<Props> = ({
|
|
65
|
+
const EventsConfigure: React.FC<Props> = ({
|
|
66
|
+
callActive,
|
|
67
|
+
children,
|
|
68
|
+
setSttAutoStarted,
|
|
69
|
+
sttAutoStarted,
|
|
70
|
+
}) => {
|
|
71
|
+
const isSTTAlreadyActiveRef = useRef(undefined);
|
|
64
72
|
// mute user audio
|
|
65
73
|
const hostMutedUserAudioToastHeadingTT = useString<I18nMuteType>(
|
|
66
74
|
hostMutedUserToastHeading,
|
|
@@ -257,10 +265,8 @@ const EventsConfigure: React.FC<Props> = ({callActive, children}) => {
|
|
|
257
265
|
permissionStatusRef.current = permissionStatus;
|
|
258
266
|
}, [permissionStatus]);
|
|
259
267
|
|
|
260
|
-
const {hasUserJoinedRTM} = useContext(ChatContext);
|
|
268
|
+
const {hasUserJoinedRTM, isInitialQueueCompleted} = useContext(ChatContext);
|
|
261
269
|
const {startSpeechToText} = useSpeechToText();
|
|
262
|
-
const [autoStartCompleted, setAutoStartCompleted] = useState(false);
|
|
263
|
-
|
|
264
270
|
//auto start stt
|
|
265
271
|
useEffect(() => {
|
|
266
272
|
if (
|
|
@@ -268,16 +274,17 @@ const EventsConfigure: React.FC<Props> = ({callActive, children}) => {
|
|
|
268
274
|
$config.STT_AUTO_START &&
|
|
269
275
|
callActive &&
|
|
270
276
|
hasUserJoinedRTM &&
|
|
271
|
-
|
|
277
|
+
isInitialQueueCompleted &&
|
|
278
|
+
!sttAutoStarted
|
|
272
279
|
) {
|
|
273
280
|
//host will start the caption
|
|
274
|
-
if (isHost && roomId?.host) {
|
|
281
|
+
if (isHost && roomId?.host && !isSTTAlreadyActiveRef.current) {
|
|
275
282
|
logger.log(LogSource.Internals, 'STT', 'STT_AUTO_START triggered');
|
|
276
283
|
//start with default language
|
|
277
284
|
startSpeechToText(['en-US'])
|
|
278
285
|
.then(() => {
|
|
279
286
|
logger.log(LogSource.Internals, 'STT', 'STT_AUTO_START success');
|
|
280
|
-
|
|
287
|
+
setSttAutoStarted(true);
|
|
281
288
|
})
|
|
282
289
|
.catch(err => {
|
|
283
290
|
logger.log(
|
|
@@ -286,11 +293,28 @@ const EventsConfigure: React.FC<Props> = ({callActive, children}) => {
|
|
|
286
293
|
'STT_AUTO_START failed',
|
|
287
294
|
err,
|
|
288
295
|
);
|
|
289
|
-
|
|
296
|
+
setSttAutoStarted(false);
|
|
290
297
|
});
|
|
291
298
|
}
|
|
299
|
+
|
|
300
|
+
if (isHost && roomId?.host && isSTTAlreadyActiveRef.current) {
|
|
301
|
+
logger.log(
|
|
302
|
+
LogSource.Internals,
|
|
303
|
+
'STT',
|
|
304
|
+
'STT_AUTO_START triggered already by some other host success',
|
|
305
|
+
);
|
|
306
|
+
setSttAutoStarted(true);
|
|
307
|
+
}
|
|
292
308
|
}
|
|
293
|
-
}, [
|
|
309
|
+
}, [
|
|
310
|
+
callActive,
|
|
311
|
+
isHost,
|
|
312
|
+
hasUserJoinedRTM,
|
|
313
|
+
roomId,
|
|
314
|
+
sttAutoStarted,
|
|
315
|
+
isInitialQueueCompleted,
|
|
316
|
+
isSTTAlreadyActiveRef.current,
|
|
317
|
+
]);
|
|
294
318
|
|
|
295
319
|
useEffect(() => {
|
|
296
320
|
//user joined event listener
|
|
@@ -520,6 +544,11 @@ const EventsConfigure: React.FC<Props> = ({callActive, children}) => {
|
|
|
520
544
|
|
|
521
545
|
events.on(EventNames.STT_ACTIVE, data => {
|
|
522
546
|
const payload = JSON.parse(data?.payload);
|
|
547
|
+
if (payload.active) {
|
|
548
|
+
isSTTAlreadyActiveRef.current = true;
|
|
549
|
+
} else {
|
|
550
|
+
isSTTAlreadyActiveRef.current = false;
|
|
551
|
+
}
|
|
523
552
|
setRoomInfo(prev => {
|
|
524
553
|
return {
|
|
525
554
|
...prev,
|
|
@@ -93,6 +93,7 @@ const RtmConfigure = (props: any) => {
|
|
|
93
93
|
}, [defaultContent]);
|
|
94
94
|
|
|
95
95
|
const [hasUserJoinedRTM, setHasUserJoinedRTM] = useState<boolean>(false);
|
|
96
|
+
const [isInitialQueueCompleted, setIsInitialQueueCompleted] = useState(false);
|
|
96
97
|
const [onlineUsersCount, setTotalOnlineUsers] = useState<number>(0);
|
|
97
98
|
|
|
98
99
|
let engine = useRef<RtmEngine>(null!);
|
|
@@ -181,6 +182,7 @@ const RtmConfigure = (props: any) => {
|
|
|
181
182
|
});
|
|
182
183
|
setHasUserJoinedRTM(true);
|
|
183
184
|
await runQueuedEvents();
|
|
185
|
+
setIsInitialQueueCompleted(true);
|
|
184
186
|
logger.log(
|
|
185
187
|
LogSource.AgoraSDK,
|
|
186
188
|
'Log',
|
|
@@ -811,6 +813,7 @@ const RtmConfigure = (props: any) => {
|
|
|
811
813
|
return (
|
|
812
814
|
<ChatContext.Provider
|
|
813
815
|
value={{
|
|
816
|
+
isInitialQueueCompleted,
|
|
814
817
|
rtmInitTimstamp,
|
|
815
818
|
hasUserJoinedRTM,
|
|
816
819
|
engine: engine.current,
|
|
@@ -16,6 +16,15 @@ import Error from '../../subComponents/Error';
|
|
|
16
16
|
type ErrorType = {
|
|
17
17
|
name: string;
|
|
18
18
|
message: string;
|
|
19
|
+
networkError?: {
|
|
20
|
+
name?: string;
|
|
21
|
+
result?: {
|
|
22
|
+
error?: {
|
|
23
|
+
code?: number;
|
|
24
|
+
message?: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
19
28
|
};
|
|
20
29
|
type ErrorContextType = {
|
|
21
30
|
error: ErrorType | undefined;
|
|
@@ -46,12 +55,17 @@ const ErrorProvider = (props: {children: React.ReactNode}) => {
|
|
|
46
55
|
const CommonError: React.FC = () => {
|
|
47
56
|
const {error} = useContext(ErrorContext);
|
|
48
57
|
useEffect(() => {
|
|
49
|
-
if (
|
|
58
|
+
if (
|
|
59
|
+
error?.networkError?.name ||
|
|
60
|
+
error?.networkError?.result?.error?.message ||
|
|
61
|
+
error?.name ||
|
|
62
|
+
error?.message
|
|
63
|
+
) {
|
|
50
64
|
Toast.show({
|
|
51
65
|
leadingIconName: 'alert',
|
|
52
66
|
type: 'error',
|
|
53
|
-
text1: error.name,
|
|
54
|
-
text2: error.message,
|
|
67
|
+
text1: error?.networkError?.name || error.name,
|
|
68
|
+
text2: error?.networkError?.result?.error?.message || error.message,
|
|
55
69
|
visibilityTime: 1000 * 10,
|
|
56
70
|
primaryBtn: null,
|
|
57
71
|
secondaryBtn: null,
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
invitePopupHeading,
|
|
38
38
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
39
39
|
import {cancelText} from '../../language/default-labels/commonLabels';
|
|
40
|
+
import {logger, LogSource} from '../../logger/AppBuilderLogger';
|
|
40
41
|
|
|
41
42
|
const InvitePopup = () => {
|
|
42
43
|
const {setShowInvitePopup, showInvitePopup} = useVideoCall();
|
|
@@ -47,6 +48,21 @@ const InvitePopup = () => {
|
|
|
47
48
|
const getMeeting = useGetMeetingPhrase();
|
|
48
49
|
useEffect(() => {
|
|
49
50
|
getMeeting(phrase).catch(error => {
|
|
51
|
+
logger.error(
|
|
52
|
+
LogSource.Internals,
|
|
53
|
+
'GET_MEETING_PHRASE',
|
|
54
|
+
'unable to fetch meeting details',
|
|
55
|
+
error,
|
|
56
|
+
{
|
|
57
|
+
networkError: {
|
|
58
|
+
name: error?.networkError?.name,
|
|
59
|
+
//@ts-ignore
|
|
60
|
+
code: error?.networkError?.result?.error?.code,
|
|
61
|
+
//@ts-ignore
|
|
62
|
+
message: error?.networkError?.result?.error?.message,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
);
|
|
50
66
|
setGlobalErrorMessage(error);
|
|
51
67
|
});
|
|
52
68
|
}, [phrase]);
|
|
@@ -116,6 +116,7 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
116
116
|
context: {
|
|
117
117
|
headers: {
|
|
118
118
|
'X-Request-Id': requestId,
|
|
119
|
+
'X-Session-Id': logger.getSessionId(),
|
|
119
120
|
},
|
|
120
121
|
},
|
|
121
122
|
variables: {
|
|
@@ -145,6 +146,13 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
145
146
|
'ERROR, could not save the name',
|
|
146
147
|
error,
|
|
147
148
|
{
|
|
149
|
+
networkError: {
|
|
150
|
+
name: error?.networkError?.name,
|
|
151
|
+
//@ts-ignore
|
|
152
|
+
code: error?.networkError?.result?.error?.code,
|
|
153
|
+
//@ts-ignore
|
|
154
|
+
message: error?.networkError?.result?.error?.message,
|
|
155
|
+
},
|
|
148
156
|
startReqTs,
|
|
149
157
|
endReqTs,
|
|
150
158
|
latency: endReqTs - startReqTs,
|
|
@@ -160,6 +168,13 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
160
168
|
'ERROR, could not save the name',
|
|
161
169
|
error,
|
|
162
170
|
{
|
|
171
|
+
networkError: {
|
|
172
|
+
name: error?.networkError?.name,
|
|
173
|
+
//@ts-ignore
|
|
174
|
+
code: error?.networkError?.result?.error?.code,
|
|
175
|
+
//@ts-ignore
|
|
176
|
+
message: error?.networkError?.result?.error?.message,
|
|
177
|
+
},
|
|
163
178
|
startReqTs,
|
|
164
179
|
endReqTs,
|
|
165
180
|
latency: endReqTs - startReqTs,
|
|
@@ -359,6 +359,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
359
359
|
myHeaders2.append('Content-Type', 'application/json');
|
|
360
360
|
myHeaders2.append('Authorization', `Bearer ${store?.token}`);
|
|
361
361
|
myHeaders2.append('X-Request-Id', requestId);
|
|
362
|
+
myHeaders2.append('X-Session-Id', logger.getSessionId());
|
|
362
363
|
|
|
363
364
|
const body = JSON.stringify({
|
|
364
365
|
resource_url: url,
|
|
@@ -498,6 +499,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
498
499
|
myHeaders2.append('Content-Type', 'application/json');
|
|
499
500
|
myHeaders2.append('Authorization', `Bearer ${store?.token}`);
|
|
500
501
|
myHeaders2.append('X-Request-Id', requestId);
|
|
502
|
+
myHeaders2.append('X-Session-Id', logger.getSessionId());
|
|
501
503
|
const body = JSON.stringify({
|
|
502
504
|
resource_url: url,
|
|
503
505
|
});
|
|
@@ -624,6 +626,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
624
626
|
headers: {
|
|
625
627
|
authorization: store?.token ? `Bearer ${store?.token}` : '',
|
|
626
628
|
'X-Request-Id': requestId,
|
|
629
|
+
'X-Session-Id': logger.getSessionId(),
|
|
627
630
|
},
|
|
628
631
|
})
|
|
629
632
|
.then(async res => {
|
|
@@ -148,6 +148,7 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
|
|
|
148
148
|
myHeaders2.append('Content-Type', 'application/json');
|
|
149
149
|
myHeaders2.append('Authorization', `Bearer ${store?.token}`);
|
|
150
150
|
myHeaders2.append('X-Request-Id', requestId);
|
|
151
|
+
myHeaders2.append('X-Session-Id', logger.getSessionId());
|
|
151
152
|
const body = JSON.stringify({
|
|
152
153
|
room_uuid: room_uuid,
|
|
153
154
|
path: '/init',
|
|
@@ -212,6 +212,15 @@ const Create = () => {
|
|
|
212
212
|
'CREATE_MEETING',
|
|
213
213
|
'There was error while creating meeting',
|
|
214
214
|
error,
|
|
215
|
+
{
|
|
216
|
+
networkError: {
|
|
217
|
+
name: error?.networkError?.name,
|
|
218
|
+
//@ts-ignore
|
|
219
|
+
code: error?.networkError?.result?.error?.code,
|
|
220
|
+
//@ts-ignore
|
|
221
|
+
message: error?.networkError?.result?.error?.message,
|
|
222
|
+
},
|
|
223
|
+
},
|
|
215
224
|
);
|
|
216
225
|
if (
|
|
217
226
|
createRoomErrorToastHeadingText ||
|
|
@@ -130,6 +130,21 @@ const Join = () => {
|
|
|
130
130
|
history.push(phrase);
|
|
131
131
|
})
|
|
132
132
|
.catch(error => {
|
|
133
|
+
logger.error(
|
|
134
|
+
LogSource.Internals,
|
|
135
|
+
'JOIN_MEETING',
|
|
136
|
+
'Error on join room page',
|
|
137
|
+
error,
|
|
138
|
+
{
|
|
139
|
+
networkError: {
|
|
140
|
+
name: error?.networkError?.name,
|
|
141
|
+
//@ts-ignore
|
|
142
|
+
code: error?.networkError?.result?.error?.code,
|
|
143
|
+
//@ts-ignore
|
|
144
|
+
message: error?.networkError?.result?.error?.message,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
);
|
|
133
148
|
const isInvalidUrl =
|
|
134
149
|
error?.message.toLowerCase().trim() === 'invalid passphrase' || false;
|
|
135
150
|
Toast.show({
|
|
@@ -150,6 +150,7 @@ const VideoCall: React.FC = () => {
|
|
|
150
150
|
const [queryComplete, setQueryComplete] = useState(false);
|
|
151
151
|
const [waitingRoomAttendeeJoined, setWaitingRoomAttendeeJoined] =
|
|
152
152
|
useState(false);
|
|
153
|
+
const [sttAutoStarted, setSttAutoStarted] = useState(false);
|
|
153
154
|
|
|
154
155
|
const {phrase} = useParams<{phrase: string}>();
|
|
155
156
|
|
|
@@ -249,6 +250,21 @@ const VideoCall: React.FC = () => {
|
|
|
249
250
|
useJoin(phrase, RoomInfoDefaultValue.roomPreference)
|
|
250
251
|
.then(() => {})
|
|
251
252
|
.catch(error => {
|
|
253
|
+
logger.error(
|
|
254
|
+
LogSource.Internals,
|
|
255
|
+
'JOIN_MEETING',
|
|
256
|
+
'Join channel error',
|
|
257
|
+
error,
|
|
258
|
+
{
|
|
259
|
+
networkError: {
|
|
260
|
+
name: error?.networkError?.name,
|
|
261
|
+
//@ts-ignore
|
|
262
|
+
code: error?.networkError?.result?.error?.code,
|
|
263
|
+
//@ts-ignore
|
|
264
|
+
message: error?.networkError?.result?.error?.message,
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
);
|
|
252
268
|
setGlobalErrorMessage(error);
|
|
253
269
|
history.push('/');
|
|
254
270
|
});
|
|
@@ -287,6 +303,21 @@ const VideoCall: React.FC = () => {
|
|
|
287
303
|
setQueryComplete(false);
|
|
288
304
|
currentMeetingPhrase.current = sdkMeetingPath;
|
|
289
305
|
useJoin(sdkMeetingPhrase, preference).catch(error => {
|
|
306
|
+
logger.error(
|
|
307
|
+
LogSource.Internals,
|
|
308
|
+
'JOIN_MEETING',
|
|
309
|
+
'Join channel error',
|
|
310
|
+
error,
|
|
311
|
+
{
|
|
312
|
+
networkError: {
|
|
313
|
+
name: error?.networkError?.name,
|
|
314
|
+
//@ts-ignore
|
|
315
|
+
code: error?.networkError?.result?.error?.code,
|
|
316
|
+
//@ts-ignore
|
|
317
|
+
message: error?.networkError?.result?.error?.message,
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
);
|
|
290
321
|
setGlobalErrorMessage(error);
|
|
291
322
|
history.push('/');
|
|
292
323
|
currentMeetingPhrase.current = '';
|
|
@@ -435,6 +466,10 @@ const VideoCall: React.FC = () => {
|
|
|
435
466
|
<CaptionProvider>
|
|
436
467
|
<WaitingRoomProvider>
|
|
437
468
|
<EventsConfigure
|
|
469
|
+
setSttAutoStarted={
|
|
470
|
+
setSttAutoStarted
|
|
471
|
+
}
|
|
472
|
+
sttAutoStarted={sttAutoStarted}
|
|
438
473
|
callActive={callActive}>
|
|
439
474
|
<ScreenshareConfigure
|
|
440
475
|
isRecordingActive={
|
|
@@ -65,6 +65,7 @@ const useSTTAPI = (): IuseSTTAPI => {
|
|
|
65
65
|
'Content-Type': 'application/json',
|
|
66
66
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
67
67
|
'X-Request-Id': requestId,
|
|
68
|
+
'X-Session-Id': logger.getSessionId(),
|
|
68
69
|
},
|
|
69
70
|
body: JSON.stringify({
|
|
70
71
|
passphrase: roomId?.host || '',
|
|
@@ -274,6 +274,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
274
274
|
'Content-Type': 'application/json',
|
|
275
275
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
276
276
|
'X-Request-Id': requestId,
|
|
277
|
+
'X-Session-Id': logger.getSessionId(),
|
|
277
278
|
},
|
|
278
279
|
body: JSON.stringify({
|
|
279
280
|
passphrase: roomId.host,
|
|
@@ -356,7 +357,19 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
356
357
|
'recording_start',
|
|
357
358
|
'Error while start recording',
|
|
358
359
|
err,
|
|
359
|
-
{
|
|
360
|
+
{
|
|
361
|
+
networkError: {
|
|
362
|
+
name: err?.networkError?.name,
|
|
363
|
+
//@ts-ignore
|
|
364
|
+
code: err?.networkError?.result?.error?.code,
|
|
365
|
+
//@ts-ignore
|
|
366
|
+
message: err?.networkError?.result?.error?.message,
|
|
367
|
+
},
|
|
368
|
+
startReqTs,
|
|
369
|
+
endRequestTs,
|
|
370
|
+
latency,
|
|
371
|
+
requestId,
|
|
372
|
+
},
|
|
360
373
|
);
|
|
361
374
|
setRecordingActive(false);
|
|
362
375
|
setInProgress(false);
|
|
@@ -405,6 +418,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
405
418
|
'Content-Type': 'application/json',
|
|
406
419
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
407
420
|
'X-Request-Id': requestId,
|
|
421
|
+
'X-Session-Id': logger.getSessionId(),
|
|
408
422
|
},
|
|
409
423
|
body: JSON.stringify({
|
|
410
424
|
passphrase: roomId.host,
|
|
@@ -548,6 +562,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
548
562
|
'Content-Type': 'application/json',
|
|
549
563
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
550
564
|
'X-Request-Id': requestId,
|
|
565
|
+
'X-Session-Id': logger.getSessionId(),
|
|
551
566
|
},
|
|
552
567
|
body: JSON.stringify({
|
|
553
568
|
passphrase: roomId?.host,
|
|
@@ -3,6 +3,8 @@ import {useParams} from '../../components/Router';
|
|
|
3
3
|
|
|
4
4
|
import {gql, useMutation} from '@apollo/client';
|
|
5
5
|
import {UidType} from '../../../agora-rn-uikit';
|
|
6
|
+
import {logger, LogSource} from '../../logger/AppBuilderLogger';
|
|
7
|
+
import getUniqueID from '../../utils/getUniqueID';
|
|
6
8
|
|
|
7
9
|
const SET_PRESENTER = gql`
|
|
8
10
|
mutation setPresenter($uid: Int!, $passphrase: String!) {
|
|
@@ -29,25 +31,88 @@ function useRecordingLayoutQuery() {
|
|
|
29
31
|
* https://docs.agora.io/en/cloud-recording/cloud_recording_layout?platform=RESTful
|
|
30
32
|
*/
|
|
31
33
|
const executePresenterQuery = (screenShareUid: UidType) => {
|
|
34
|
+
const requestId = getUniqueID();
|
|
35
|
+
const startReqTs = Date.now();
|
|
32
36
|
setPresenterQuery({
|
|
33
37
|
variables: {
|
|
34
38
|
uid: screenShareUid,
|
|
35
39
|
passphrase: phrase,
|
|
36
40
|
},
|
|
41
|
+
context: {
|
|
42
|
+
headers: {
|
|
43
|
+
'X-Request-Id': requestId,
|
|
44
|
+
'X-Session-Id': logger.getSessionId(),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
37
47
|
})
|
|
38
|
-
.then(
|
|
39
|
-
if (res
|
|
48
|
+
.then(res => {
|
|
49
|
+
if (res?.data?.setPresenter === 'success') {
|
|
50
|
+
const endReqTs = Date.now();
|
|
51
|
+
logger.log(
|
|
52
|
+
LogSource.Internals,
|
|
53
|
+
'RECORDING',
|
|
54
|
+
'setPresenterQuery success',
|
|
55
|
+
{
|
|
56
|
+
responseData: res,
|
|
57
|
+
startReqTs,
|
|
58
|
+
endReqTs,
|
|
59
|
+
latency: endReqTs - startReqTs,
|
|
60
|
+
requestId,
|
|
61
|
+
},
|
|
62
|
+
);
|
|
40
63
|
}
|
|
41
64
|
})
|
|
42
|
-
.catch(
|
|
43
|
-
|
|
65
|
+
.catch(error => {
|
|
66
|
+
const endReqTs = Date.now();
|
|
67
|
+
logger.error(
|
|
68
|
+
LogSource.Internals,
|
|
69
|
+
'RECORDING',
|
|
70
|
+
'setPresenterQuery failure',
|
|
71
|
+
error,
|
|
72
|
+
{
|
|
73
|
+
networkError: {
|
|
74
|
+
name: error?.networkError?.name,
|
|
75
|
+
//@ts-ignore
|
|
76
|
+
code: error?.networkError?.result?.error?.code,
|
|
77
|
+
//@ts-ignore
|
|
78
|
+
message: error?.networkError?.result?.error?.message,
|
|
79
|
+
},
|
|
80
|
+
startReqTs,
|
|
81
|
+
endReqTs,
|
|
82
|
+
latency: endReqTs - startReqTs,
|
|
83
|
+
requestId,
|
|
84
|
+
},
|
|
85
|
+
);
|
|
44
86
|
});
|
|
45
87
|
};
|
|
46
88
|
|
|
47
89
|
const executeNormalQuery = () => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
90
|
+
const requestId = getUniqueID();
|
|
91
|
+
const startReqTs = Date.now();
|
|
92
|
+
setNormalQuery({
|
|
93
|
+
variables: {passphrase: phrase},
|
|
94
|
+
context: {
|
|
95
|
+
headers: {
|
|
96
|
+
'X-Request-Id': requestId,
|
|
97
|
+
'X-Session-Id': logger.getSessionId(),
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
.then(res => {
|
|
102
|
+
if (res?.data?.stopRecordingSession === 'success') {
|
|
103
|
+
const endReqTs = Date.now();
|
|
104
|
+
logger.log(
|
|
105
|
+
LogSource.Internals,
|
|
106
|
+
'RECORDING',
|
|
107
|
+
'executeNormalQuery success',
|
|
108
|
+
{
|
|
109
|
+
responseData: res,
|
|
110
|
+
startReqTs,
|
|
111
|
+
endReqTs,
|
|
112
|
+
latency: endReqTs - startReqTs,
|
|
113
|
+
requestId,
|
|
114
|
+
},
|
|
115
|
+
);
|
|
51
116
|
// Once the backend sucessfuly stops recording,
|
|
52
117
|
// send a control message to everbody in the channel indicating that cloud recording is now inactive.
|
|
53
118
|
// sendControlMessage(controlMessageEnum.cloudRecordingUnactive);
|
|
@@ -55,8 +120,27 @@ function useRecordingLayoutQuery() {
|
|
|
55
120
|
// setScreenshareActive(false);
|
|
56
121
|
}
|
|
57
122
|
})
|
|
58
|
-
.catch(
|
|
59
|
-
|
|
123
|
+
.catch(error => {
|
|
124
|
+
const endReqTs = Date.now();
|
|
125
|
+
logger.error(
|
|
126
|
+
LogSource.Internals,
|
|
127
|
+
'RECORDING',
|
|
128
|
+
'executeNormalQuery failure',
|
|
129
|
+
error,
|
|
130
|
+
{
|
|
131
|
+
networkError: {
|
|
132
|
+
name: error?.networkError?.name,
|
|
133
|
+
//@ts-ignore
|
|
134
|
+
code: error?.networkError?.result?.error?.code,
|
|
135
|
+
//@ts-ignore
|
|
136
|
+
message: error?.networkError?.result?.error?.message,
|
|
137
|
+
},
|
|
138
|
+
startReqTs,
|
|
139
|
+
endReqTs,
|
|
140
|
+
latency: endReqTs - startReqTs,
|
|
141
|
+
requestId,
|
|
142
|
+
},
|
|
143
|
+
);
|
|
60
144
|
});
|
|
61
145
|
};
|
|
62
146
|
|
|
@@ -17,11 +17,6 @@ import {
|
|
|
17
17
|
import Platform from '../subComponents/Platform';
|
|
18
18
|
import * as ReactIs from 'react-is';
|
|
19
19
|
|
|
20
|
-
const getSessionId = () => {
|
|
21
|
-
const {logger} = require('../logger/AppBuilderLogger');
|
|
22
|
-
return logger.getSessionId();
|
|
23
|
-
};
|
|
24
|
-
|
|
25
20
|
const trimText = (text: string, length: number = 25) => {
|
|
26
21
|
if (!text) {
|
|
27
22
|
return '';
|
|
@@ -386,7 +381,6 @@ function MergeMoreButtonFields(sourceArray, updateObject) {
|
|
|
386
381
|
}
|
|
387
382
|
|
|
388
383
|
export {
|
|
389
|
-
getSessionId,
|
|
390
384
|
updateToolbarDefaultConfig,
|
|
391
385
|
useIsDesktop,
|
|
392
386
|
useIsSmall,
|
|
@@ -56,6 +56,7 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
56
56
|
context: {
|
|
57
57
|
headers: {
|
|
58
58
|
'X-Request-Id': requestId,
|
|
59
|
+
'X-Session-Id': logger.getSessionId(),
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
62
|
variables: {
|
|
@@ -75,7 +76,19 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
75
76
|
'createChannel',
|
|
76
77
|
'API createChannel failed. There was an error',
|
|
77
78
|
error,
|
|
78
|
-
{
|
|
79
|
+
{
|
|
80
|
+
networkError: {
|
|
81
|
+
name: error?.networkError?.name,
|
|
82
|
+
//@ts-ignore
|
|
83
|
+
code: error?.networkError?.result?.error?.code,
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
message: error?.networkError?.result?.error?.message,
|
|
86
|
+
},
|
|
87
|
+
startReqTs,
|
|
88
|
+
endReqTs,
|
|
89
|
+
latency: latency,
|
|
90
|
+
requestId,
|
|
91
|
+
},
|
|
79
92
|
);
|
|
80
93
|
throw error;
|
|
81
94
|
}
|
|
@@ -42,6 +42,7 @@ export default function useGetMeetingPhrase() {
|
|
|
42
42
|
context: {
|
|
43
43
|
headers: {
|
|
44
44
|
'X-Request-Id': requestId,
|
|
45
|
+
'X-Session-Id': logger.getSessionId(),
|
|
45
46
|
},
|
|
46
47
|
},
|
|
47
48
|
query: SHARE,
|
|
@@ -57,6 +58,13 @@ export default function useGetMeetingPhrase() {
|
|
|
57
58
|
'Query GET_MEETING_PHRASE failed',
|
|
58
59
|
response.error,
|
|
59
60
|
{
|
|
61
|
+
networkError: {
|
|
62
|
+
name: response?.error?.networkError?.name,
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
code: response?.error?.networkError?.result?.error?.code,
|
|
65
|
+
//@ts-ignore
|
|
66
|
+
message: response?.error?.networkError?.result?.error?.message,
|
|
67
|
+
},
|
|
60
68
|
requestId,
|
|
61
69
|
startReqTs,
|
|
62
70
|
endReqTs,
|
|
@@ -128,6 +128,7 @@ export default function useJoinRoom() {
|
|
|
128
128
|
context: {
|
|
129
129
|
headers: {
|
|
130
130
|
'X-Request-Id': requestId,
|
|
131
|
+
'X-Session-Id': logger.getSessionId(),
|
|
131
132
|
},
|
|
132
133
|
},
|
|
133
134
|
query:
|
|
@@ -149,8 +150,16 @@ export default function useJoinRoom() {
|
|
|
149
150
|
`API ${
|
|
150
151
|
isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'
|
|
151
152
|
} failed.`,
|
|
153
|
+
'Join Channel Failed',
|
|
152
154
|
response?.error,
|
|
153
155
|
{
|
|
156
|
+
networkError: {
|
|
157
|
+
name: response?.error?.networkError?.name,
|
|
158
|
+
//@ts-ignore
|
|
159
|
+
code: response?.error?.networkError?.result?.error?.code,
|
|
160
|
+
//@ts-ignore
|
|
161
|
+
message: response?.error?.networkError?.result?.error?.message,
|
|
162
|
+
},
|
|
154
163
|
startReqTs,
|
|
155
164
|
endReqTs,
|
|
156
165
|
latency,
|
|
@@ -34,6 +34,7 @@ const useMutePSTN = () => {
|
|
|
34
34
|
context: {
|
|
35
35
|
headers: {
|
|
36
36
|
'X-Request-Id': requestId,
|
|
37
|
+
'X-Session-Id': logger.getSessionId(),
|
|
37
38
|
},
|
|
38
39
|
},
|
|
39
40
|
variables: {
|
|
@@ -53,7 +54,19 @@ const useMutePSTN = () => {
|
|
|
53
54
|
'MUTE_PSTN',
|
|
54
55
|
'Mutation MUTE_PSTN success',
|
|
55
56
|
error,
|
|
56
|
-
{
|
|
57
|
+
{
|
|
58
|
+
networkError: {
|
|
59
|
+
name: error?.networkError?.name,
|
|
60
|
+
//@ts-ignore
|
|
61
|
+
code: error?.networkError?.result?.error?.code,
|
|
62
|
+
//@ts-ignore
|
|
63
|
+
message: error?.networkError?.result?.error?.message,
|
|
64
|
+
},
|
|
65
|
+
startReqTs,
|
|
66
|
+
endReqTs,
|
|
67
|
+
latency: endReqTs - startReqTs,
|
|
68
|
+
requestId,
|
|
69
|
+
},
|
|
57
70
|
);
|
|
58
71
|
throw error;
|
|
59
72
|
} else {
|