agora-appbuilder-core 4.0.28-beta-8 → 4.0.28-beta-10
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 +2 -2
- 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/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 +18 -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 +8 -0
- package/template/src/utils/useMutePSTN.ts +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agora-appbuilder-core",
|
|
3
|
-
"version": "4.0.28-beta-
|
|
3
|
+
"version": "4.0.28-beta-10",
|
|
4
4
|
"description": "React Native template for RTE app builder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"vercel-build": "npm run dev-setup && cd template && npm run web:build && cd .. && npm run copy-vercel",
|
|
12
|
-
"uikit": "rm -rf template/agora-rn-uikit && git clone https://github.com/AgoraIO-Community/ReactNative-UIKit.git template/agora-rn-uikit && cd template/agora-rn-uikit && git checkout appbuilder-uikit-3.0.28",
|
|
12
|
+
"uikit": "rm -rf template/agora-rn-uikit && git clone https://github.com/AgoraIO-Community/ReactNative-UIKit.git template/agora-rn-uikit && cd template/agora-rn-uikit && git checkout appbuilder-uikit-3.0.28-fixes",
|
|
13
13
|
"deps": "cd template && npm i --force",
|
|
14
14
|
"dev-setup": "npm run uikit && npm run deps && node devSetup.js",
|
|
15
15
|
"web-build": "cd template && npm run web:build && cd .. && npm run copy-vercel",
|
|
@@ -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';
|
|
@@ -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,
|
|
@@ -515,6 +521,7 @@ const AuthProvider = (props: AuthProviderProps) => {
|
|
|
515
521
|
credentials: 'include',
|
|
516
522
|
headers: {
|
|
517
523
|
'X-Request-Id': requestId,
|
|
524
|
+
'X-Session-Id': logger.getSessionId(),
|
|
518
525
|
},
|
|
519
526
|
})
|
|
520
527
|
.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,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({
|
|
@@ -249,6 +249,15 @@ const VideoCall: React.FC = () => {
|
|
|
249
249
|
useJoin(phrase, RoomInfoDefaultValue.roomPreference)
|
|
250
250
|
.then(() => {})
|
|
251
251
|
.catch(error => {
|
|
252
|
+
logger.error(LogSource.Internals, 'JOIN_MEETING', error, {
|
|
253
|
+
networkError: {
|
|
254
|
+
name: error?.networkError?.name,
|
|
255
|
+
//@ts-ignore
|
|
256
|
+
code: error?.networkError?.result?.error?.code,
|
|
257
|
+
//@ts-ignore
|
|
258
|
+
message: error?.networkError?.result?.error?.message,
|
|
259
|
+
},
|
|
260
|
+
});
|
|
252
261
|
setGlobalErrorMessage(error);
|
|
253
262
|
history.push('/');
|
|
254
263
|
});
|
|
@@ -287,6 +296,15 @@ const VideoCall: React.FC = () => {
|
|
|
287
296
|
setQueryComplete(false);
|
|
288
297
|
currentMeetingPhrase.current = sdkMeetingPath;
|
|
289
298
|
useJoin(sdkMeetingPhrase, preference).catch(error => {
|
|
299
|
+
logger.error(LogSource.Internals, 'JOIN_MEETING', error, {
|
|
300
|
+
networkError: {
|
|
301
|
+
name: error?.networkError?.name,
|
|
302
|
+
//@ts-ignore
|
|
303
|
+
code: error?.networkError?.result?.error?.code,
|
|
304
|
+
//@ts-ignore
|
|
305
|
+
message: error?.networkError?.result?.error?.message,
|
|
306
|
+
},
|
|
307
|
+
});
|
|
290
308
|
setGlobalErrorMessage(error);
|
|
291
309
|
history.push('/');
|
|
292
310
|
currentMeetingPhrase.current = '';
|
|
@@ -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 || '',
|
|
@@ -273,6 +273,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
273
273
|
'Content-Type': 'application/json',
|
|
274
274
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
275
275
|
'X-Request-Id': requestId,
|
|
276
|
+
'X-Session-Id': logger.getSessionId(),
|
|
276
277
|
},
|
|
277
278
|
body: JSON.stringify({
|
|
278
279
|
passphrase: roomId.host,
|
|
@@ -355,7 +356,19 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
355
356
|
'recording_start',
|
|
356
357
|
'Error while start recording',
|
|
357
358
|
err,
|
|
358
|
-
{
|
|
359
|
+
{
|
|
360
|
+
networkError: {
|
|
361
|
+
name: err?.networkError?.name,
|
|
362
|
+
//@ts-ignore
|
|
363
|
+
code: err?.networkError?.result?.error?.code,
|
|
364
|
+
//@ts-ignore
|
|
365
|
+
message: err?.networkError?.result?.error?.message,
|
|
366
|
+
},
|
|
367
|
+
startReqTs,
|
|
368
|
+
endRequestTs,
|
|
369
|
+
latency,
|
|
370
|
+
requestId,
|
|
371
|
+
},
|
|
359
372
|
);
|
|
360
373
|
setRecordingActive(false);
|
|
361
374
|
setInProgress(false);
|
|
@@ -404,6 +417,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
404
417
|
'Content-Type': 'application/json',
|
|
405
418
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
406
419
|
'X-Request-Id': requestId,
|
|
420
|
+
'X-Session-Id': logger.getSessionId(),
|
|
407
421
|
},
|
|
408
422
|
body: JSON.stringify({
|
|
409
423
|
passphrase: roomId.host,
|
|
@@ -547,6 +561,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
547
561
|
'Content-Type': 'application/json',
|
|
548
562
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
549
563
|
'X-Request-Id': requestId,
|
|
564
|
+
'X-Session-Id': logger.getSessionId(),
|
|
550
565
|
},
|
|
551
566
|
body: JSON.stringify({
|
|
552
567
|
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:
|
|
@@ -151,6 +152,13 @@ export default function useJoinRoom() {
|
|
|
151
152
|
} failed.`,
|
|
152
153
|
response?.error,
|
|
153
154
|
{
|
|
155
|
+
networkError: {
|
|
156
|
+
name: response?.error?.networkError?.name,
|
|
157
|
+
//@ts-ignore
|
|
158
|
+
code: response?.error?.networkError?.result?.error?.code,
|
|
159
|
+
//@ts-ignore
|
|
160
|
+
message: response?.error?.networkError?.result?.error?.message,
|
|
161
|
+
},
|
|
154
162
|
startReqTs,
|
|
155
163
|
endReqTs,
|
|
156
164
|
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 {
|