agora-appbuilder-core 4.0.24 → 4.0.25-beta-2
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/.eslintrc.js +0 -5
- package/template/agora-rn-uikit/package-lock.json +6116 -23528
- package/template/agora-rn-uikit/package.json +14 -14
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +6 -6
- package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +6 -6
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +40 -79
- package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +10 -0
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +17 -26
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Icons.ts +0 -51
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -6
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +1 -3
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +2 -5
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +2 -5
- package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -0
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -7
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +5 -5
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +1 -3
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +11 -0
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +7 -8
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +7 -8
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +7 -6
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +8 -7
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +9 -9
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +8 -7
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +13 -14
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +7 -6
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +7 -6
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +6 -5
- package/template/agora-rn-uikit/src/Reducer/UserPin.ts +3 -20
- package/template/agora-rn-uikit/src/Reducer/index.ts +1 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +125 -122
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +27 -46
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +77 -175
- package/template/agora-rn-uikit/src/Utils/quality.tsx +0 -8
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +12 -56
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +17 -47
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +11 -19
- package/template/agora-rn-uikit/src/index.ts +9 -16
- package/template/customization-api/typeDefinition.ts +1 -4
- package/template/customization-api/utils.ts +1 -0
- package/template/defaultConfig.js +2 -0
- package/template/global.d.ts +2 -0
- package/template/src/AppRoutes.tsx +1 -7
- package/template/src/auth/AuthProvider.tsx +70 -24
- package/template/src/auth/useIDPAuth.electron.tsx +59 -2
- package/template/src/auth/useIDPAuth.native.tsx +59 -2
- package/template/src/auth/useIDPAuth.tsx +60 -2
- package/template/src/auth/useTokenAuth.tsx +66 -4
- package/template/src/components/DeviceConfigure.tsx +74 -68
- package/template/src/components/GraphQLProvider.tsx +0 -1
- package/template/src/components/contexts/WaitingRoomContext.tsx +11 -4
- package/template/src/components/recording-bot/RecordingBotRoute.tsx +1 -1
- package/template/src/components/useUserPreference.tsx +56 -9
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +4 -1
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +185 -24
- package/template/src/components/whiteboard/WhiteboardWidget.tsx +47 -6
- package/template/src/logger/AppBuilderLogger.tsx +94 -36
- package/template/src/logger/transports/customer-transport.ts +7 -3
- package/template/src/pages/VideoCall.tsx +3 -5
- package/template/src/subComponents/SelectDevice.tsx +14 -52
- package/template/src/subComponents/caption/useSTTAPI.tsx +39 -3
- package/template/src/subComponents/recording/useRecording.tsx +69 -20
- package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +30 -8
- package/template/src/utils/common.tsx +6 -1
- package/template/src/utils/useCreateRoom.ts +21 -2
- package/template/src/utils/useFindActiveSpeaker.ts +12 -5
- package/template/src/utils/useGetMeetingPhrase.ts +44 -1
- package/template/src/utils/useJoinRoom.ts +29 -2
- package/template/src/utils/useMutePSTN.ts +29 -0
- package/template/agora-rn-uikit/src/Contexts/ContentContext.tsx +0 -10
- package/template/agora-rn-uikit/src/Contexts/DispatchContext.tsx +0 -22
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeaker.ts +0 -30
- package/template/agora-rn-uikit/src/Reducer/UserSecondaryPin.ts +0 -23
- package/template/agora-rn-uikit/src/Utils/isBotUser.ts +0 -15
|
@@ -62,7 +62,9 @@ const applyDefaultPrefixConditionally = (device: MediaDeviceInfo) => {
|
|
|
62
62
|
* A component to diplay a dropdown and select a device.
|
|
63
63
|
* It will add the selected device to the device context.
|
|
64
64
|
*/
|
|
65
|
-
const useSelectDevice = (
|
|
65
|
+
const useSelectDevice = (
|
|
66
|
+
type?: 'Camera' | 'Microphone' | 'Speaker' | 'ToDisplayInfo',
|
|
67
|
+
): [boolean, string] => {
|
|
66
68
|
const {rtcProps} = useContext(PropsContext);
|
|
67
69
|
const {primaryColor} = useContext(ColorContext);
|
|
68
70
|
const [btnTheme, setBtnTheme] = React.useState<string>(primaryColor);
|
|
@@ -73,19 +75,16 @@ const useSelectDevice = (): [boolean, string] => {
|
|
|
73
75
|
$config.EVENT_MODE &&
|
|
74
76
|
rtcProps.role === ClientRoleType.ClientRoleAudience
|
|
75
77
|
) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
type === 'ToDisplayInfo'
|
|
79
|
+
? {}
|
|
80
|
+
: logger.log(
|
|
81
|
+
LogSource.Internals,
|
|
82
|
+
'DEVICE_CONFIGURE',
|
|
83
|
+
`User is AUDIENCE and in Live mode - ${type} Dropdown is disabled`,
|
|
84
|
+
);
|
|
81
85
|
setPickerDisabled(true);
|
|
82
86
|
setBtnTheme('rgba(16, 16, 16, 0.3)');
|
|
83
87
|
} else {
|
|
84
|
-
logger.log(
|
|
85
|
-
LogSource.Internals,
|
|
86
|
-
'DEVICE_CONFIGURE',
|
|
87
|
-
'User is HOST - device picker is enabled',
|
|
88
|
-
);
|
|
89
88
|
setPickerDisabled(false);
|
|
90
89
|
setBtnTheme(primaryColor);
|
|
91
90
|
}
|
|
@@ -106,7 +105,7 @@ interface SelectVideoDeviceProps {
|
|
|
106
105
|
|
|
107
106
|
const SelectVideoDevice = (props: SelectVideoDeviceProps) => {
|
|
108
107
|
const {selectedCam, setSelectedCam, deviceList} = useContext(DeviceContext);
|
|
109
|
-
const [isPickerDisabled, btnTheme] = useSelectDevice();
|
|
108
|
+
const [isPickerDisabled, btnTheme] = useSelectDevice('Camera');
|
|
110
109
|
const [isFocussed, setIsFocussed] = React.useState(false);
|
|
111
110
|
const [isPendingUpdate, setIsPendingUpdate] = useState(isPickerDisabled);
|
|
112
111
|
const local = useContext(LocalContext);
|
|
@@ -217,7 +216,7 @@ interface SelectAudioDeviceProps {
|
|
|
217
216
|
|
|
218
217
|
const SelectAudioDevice = (props: SelectAudioDeviceProps) => {
|
|
219
218
|
const {selectedMic, setSelectedMic, deviceList} = useContext(DeviceContext);
|
|
220
|
-
const [isPickerDisabled, btnTheme] = useSelectDevice();
|
|
219
|
+
const [isPickerDisabled, btnTheme] = useSelectDevice('Microphone');
|
|
221
220
|
const [isFocussed, setIsFocussed] = useState(false);
|
|
222
221
|
const local = useContext(LocalContext);
|
|
223
222
|
const [isPendingUpdate, setIsPendingUpdate] = useState(isPickerDisabled);
|
|
@@ -334,7 +333,7 @@ const SelectSpeakerDevice = (props: SelectSpeakerDeviceProps) => {
|
|
|
334
333
|
const {selectedSpeaker, setSelectedSpeaker, deviceList, isChrome} =
|
|
335
334
|
useContext(DeviceContext);
|
|
336
335
|
const local = useContext(LocalContext);
|
|
337
|
-
const [isPickerDisabled, btnTheme] = useSelectDevice();
|
|
336
|
+
const [isPickerDisabled, btnTheme] = useSelectDevice('Speaker');
|
|
338
337
|
const [isFocussed, setIsFocussed] = React.useState(false);
|
|
339
338
|
const [isPendingUpdate, setIsPendingUpdate] = useState(isPickerDisabled);
|
|
340
339
|
const newRandomDeviceId = randomNameGenerator(64).toUpperCase();
|
|
@@ -463,7 +462,7 @@ interface SelectDeviceProps {
|
|
|
463
462
|
}
|
|
464
463
|
|
|
465
464
|
const SelectDevice = (props: SelectDeviceProps) => {
|
|
466
|
-
const [isPickerDisabled] = useSelectDevice();
|
|
465
|
+
const [isPickerDisabled] = useSelectDevice('ToDisplayInfo');
|
|
467
466
|
const {deviceList} = useContext(DeviceContext);
|
|
468
467
|
const {setCameraAvailable, setMicAvailable, setSpeakerAvailable} =
|
|
469
468
|
usePreCall();
|
|
@@ -508,17 +507,6 @@ const SelectDevice = (props: SelectDeviceProps) => {
|
|
|
508
507
|
|
|
509
508
|
useEffect(() => {
|
|
510
509
|
const isDeviceAvailable = audioDevices && audioDevices.length;
|
|
511
|
-
logger.log(
|
|
512
|
-
LogSource.Internals,
|
|
513
|
-
'DEVICE_CONFIGURE',
|
|
514
|
-
'audio devices changed',
|
|
515
|
-
{
|
|
516
|
-
devices: [...audioDevices],
|
|
517
|
-
isDeviceAvailable: isDeviceAvailable
|
|
518
|
-
? 'Yes, setting mic'
|
|
519
|
-
: 'No audio devices available',
|
|
520
|
-
},
|
|
521
|
-
);
|
|
522
510
|
if (isDeviceAvailable) {
|
|
523
511
|
setMicAvailable(true);
|
|
524
512
|
}
|
|
@@ -526,19 +514,6 @@ const SelectDevice = (props: SelectDeviceProps) => {
|
|
|
526
514
|
|
|
527
515
|
useEffect(() => {
|
|
528
516
|
const isDeviceAvailable = videoDevices && videoDevices.length;
|
|
529
|
-
logger.log(
|
|
530
|
-
LogSource.Internals,
|
|
531
|
-
'DEVICE_CONFIGURE',
|
|
532
|
-
'camera devices changed',
|
|
533
|
-
{
|
|
534
|
-
data: {
|
|
535
|
-
devices: [...videoDevices],
|
|
536
|
-
isDeviceAvailable: isDeviceAvailable
|
|
537
|
-
? 'Yes, setting camera'
|
|
538
|
-
: 'No video devices available',
|
|
539
|
-
},
|
|
540
|
-
},
|
|
541
|
-
);
|
|
542
517
|
if (isDeviceAvailable) {
|
|
543
518
|
setCameraAvailable(true);
|
|
544
519
|
}
|
|
@@ -546,19 +521,6 @@ const SelectDevice = (props: SelectDeviceProps) => {
|
|
|
546
521
|
|
|
547
522
|
useEffect(() => {
|
|
548
523
|
const isDeviceAvailable = speakerDevices && speakerDevices.length;
|
|
549
|
-
logger.log(
|
|
550
|
-
LogSource.Internals,
|
|
551
|
-
'DEVICE_CONFIGURE',
|
|
552
|
-
'speaker devices changed',
|
|
553
|
-
{
|
|
554
|
-
data: {
|
|
555
|
-
devices: [...speakerDevices],
|
|
556
|
-
isDeviceAvailable: isDeviceAvailable
|
|
557
|
-
? 'Yes, setting speaker'
|
|
558
|
-
: 'No speaker devices available',
|
|
559
|
-
},
|
|
560
|
-
},
|
|
561
|
-
);
|
|
562
524
|
if (isDeviceAvailable) {
|
|
563
525
|
setSpeakerAvailable(true);
|
|
564
526
|
}
|
|
@@ -45,10 +45,18 @@ const useSTTAPI = (): IuseSTTAPI => {
|
|
|
45
45
|
}, [language]);
|
|
46
46
|
|
|
47
47
|
const apiCall = async (method: string, lang: LanguageType[] = []) => {
|
|
48
|
+
const requestId = getUniqueID();
|
|
49
|
+
const startReqTs = Date.now();
|
|
48
50
|
logger.log(
|
|
49
51
|
LogSource.NetworkRest,
|
|
50
52
|
'stt',
|
|
51
53
|
`Trying to ${method} stt for lang ${lang}`,
|
|
54
|
+
{
|
|
55
|
+
method,
|
|
56
|
+
lang,
|
|
57
|
+
requestId,
|
|
58
|
+
startReqTs,
|
|
59
|
+
},
|
|
52
60
|
);
|
|
53
61
|
try {
|
|
54
62
|
const response = await fetch(`${STT_API_URL}/${method}`, {
|
|
@@ -56,7 +64,7 @@ const useSTTAPI = (): IuseSTTAPI => {
|
|
|
56
64
|
headers: {
|
|
57
65
|
'Content-Type': 'application/json',
|
|
58
66
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
59
|
-
'X-Request-Id':
|
|
67
|
+
'X-Request-Id': requestId,
|
|
60
68
|
},
|
|
61
69
|
body: JSON.stringify({
|
|
62
70
|
passphrase: roomId?.host || '',
|
|
@@ -68,9 +76,37 @@ const useSTTAPI = (): IuseSTTAPI => {
|
|
|
68
76
|
}),
|
|
69
77
|
});
|
|
70
78
|
const res = await response.json();
|
|
71
|
-
|
|
79
|
+
const endReqTs = Date.now();
|
|
80
|
+
const latency = endReqTs - startReqTs;
|
|
81
|
+
logger.log(
|
|
82
|
+
LogSource.NetworkRest,
|
|
83
|
+
'stt',
|
|
84
|
+
`STT API Success - Called ${method} on stt with lang ${lang}`,
|
|
85
|
+
{
|
|
86
|
+
responseData: res,
|
|
87
|
+
requestId,
|
|
88
|
+
startReqTs,
|
|
89
|
+
endReqTs,
|
|
90
|
+
latency,
|
|
91
|
+
},
|
|
92
|
+
);
|
|
72
93
|
return res;
|
|
73
|
-
} catch (error) {
|
|
94
|
+
} catch (error) {
|
|
95
|
+
const endReqTs = Date.now();
|
|
96
|
+
const latency = endReqTs - startReqTs;
|
|
97
|
+
logger.error(
|
|
98
|
+
LogSource.NetworkRest,
|
|
99
|
+
'stt',
|
|
100
|
+
`STT API Failure - Called ${method} on stt with lang ${lang}`,
|
|
101
|
+
{
|
|
102
|
+
error,
|
|
103
|
+
requestId,
|
|
104
|
+
startReqTs,
|
|
105
|
+
endReqTs,
|
|
106
|
+
latency,
|
|
107
|
+
},
|
|
108
|
+
);
|
|
109
|
+
}
|
|
74
110
|
};
|
|
75
111
|
|
|
76
112
|
const startWithDelay = (lang: LanguageType[]): Promise<string> =>
|
|
@@ -249,6 +249,8 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
249
249
|
}),
|
|
250
250
|
PersistanceLevel.Session,
|
|
251
251
|
);
|
|
252
|
+
const startReqTs = Date.now();
|
|
253
|
+
const requestId = getUniqueID();
|
|
252
254
|
logger.log(
|
|
253
255
|
LogSource.NetworkRest,
|
|
254
256
|
'recording_start',
|
|
@@ -257,6 +259,8 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
257
259
|
passphrase: roomId.host,
|
|
258
260
|
url,
|
|
259
261
|
mode: recordingMode,
|
|
262
|
+
startReqTs,
|
|
263
|
+
requestId: requestId,
|
|
260
264
|
},
|
|
261
265
|
);
|
|
262
266
|
fetch(`${$config.BACKEND_ENDPOINT}/v1/recording/start`, {
|
|
@@ -264,7 +268,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
264
268
|
headers: {
|
|
265
269
|
'Content-Type': 'application/json',
|
|
266
270
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
267
|
-
'X-Request-Id':
|
|
271
|
+
'X-Request-Id': requestId,
|
|
268
272
|
},
|
|
269
273
|
body: JSON.stringify({
|
|
270
274
|
passphrase: roomId.host,
|
|
@@ -275,12 +279,20 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
275
279
|
}),
|
|
276
280
|
})
|
|
277
281
|
.then((res: any) => {
|
|
282
|
+
const endRequestTs = Date.now();
|
|
283
|
+
const latency = endRequestTs - startReqTs;
|
|
278
284
|
if (res.status === 200) {
|
|
279
285
|
logger.log(
|
|
280
286
|
LogSource.NetworkRest,
|
|
281
287
|
'recording_start',
|
|
282
288
|
'start recording successfully',
|
|
283
|
-
|
|
289
|
+
{
|
|
290
|
+
responseData: res,
|
|
291
|
+
startReqTs,
|
|
292
|
+
endRequestTs,
|
|
293
|
+
latency,
|
|
294
|
+
requestId,
|
|
295
|
+
},
|
|
284
296
|
);
|
|
285
297
|
// 1. set the local recording state to true to update the UI
|
|
286
298
|
events.send(
|
|
@@ -330,11 +342,13 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
330
342
|
}
|
|
331
343
|
})
|
|
332
344
|
.catch(err => {
|
|
345
|
+
const endRequestTs = Date.now();
|
|
346
|
+
const latency = endRequestTs - startReqTs;
|
|
333
347
|
logger.error(
|
|
334
348
|
LogSource.NetworkRest,
|
|
335
349
|
'recording_start',
|
|
336
350
|
'Error while start recording',
|
|
337
|
-
err,
|
|
351
|
+
{err, startReqTs, endRequestTs, latency, requestId},
|
|
338
352
|
);
|
|
339
353
|
setRecordingActive(false);
|
|
340
354
|
setInProgress(false);
|
|
@@ -354,12 +368,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
354
368
|
/**
|
|
355
369
|
* Any host in the channel can stop recording.
|
|
356
370
|
*/
|
|
357
|
-
|
|
358
|
-
LogSource.Internals,
|
|
359
|
-
'RECORDING',
|
|
360
|
-
'_stopRecording API called',
|
|
361
|
-
{calledBy: calledBy},
|
|
362
|
-
);
|
|
371
|
+
|
|
363
372
|
events.send(
|
|
364
373
|
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
365
374
|
JSON.stringify({
|
|
@@ -368,11 +377,20 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
368
377
|
}),
|
|
369
378
|
PersistanceLevel.Session,
|
|
370
379
|
);
|
|
380
|
+
const requestId = getUniqueID();
|
|
381
|
+
const startReqTs = Date.now();
|
|
382
|
+
logger.log(
|
|
383
|
+
LogSource.Internals,
|
|
384
|
+
'SEND_LOG_IMMEDIATELY',
|
|
385
|
+
'_stopRecording API called',
|
|
386
|
+
{calledBy: calledBy, requestId, startReqTs},
|
|
387
|
+
);
|
|
371
388
|
fetchRetry(`${$config.BACKEND_ENDPOINT}/v1/recording/stop`, {
|
|
372
389
|
method: 'POST',
|
|
373
390
|
headers: {
|
|
374
391
|
'Content-Type': 'application/json',
|
|
375
392
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
393
|
+
'X-Request-Id': requestId,
|
|
376
394
|
},
|
|
377
395
|
body: JSON.stringify({
|
|
378
396
|
passphrase: roomId.host,
|
|
@@ -380,13 +398,20 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
380
398
|
}),
|
|
381
399
|
})
|
|
382
400
|
.then(res => {
|
|
401
|
+
const endReqTs = Date.now();
|
|
383
402
|
setInProgress(false);
|
|
384
403
|
if (res.status === 200 || res.status === 202) {
|
|
385
404
|
logger.log(
|
|
386
|
-
LogSource.
|
|
387
|
-
'
|
|
405
|
+
LogSource.Internals,
|
|
406
|
+
'SEND_LOG_IMMEDIATELY',
|
|
388
407
|
'_stopRecording successfull',
|
|
389
|
-
|
|
408
|
+
{
|
|
409
|
+
res,
|
|
410
|
+
startReqTs,
|
|
411
|
+
endReqTs,
|
|
412
|
+
latency: endReqTs - startReqTs,
|
|
413
|
+
requestId,
|
|
414
|
+
},
|
|
390
415
|
);
|
|
391
416
|
/**
|
|
392
417
|
* 1. Once the backend sucessfuly stops recording, send message
|
|
@@ -413,11 +438,18 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
413
438
|
}
|
|
414
439
|
})
|
|
415
440
|
.catch(err => {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
441
|
+
const endReqTs = Date.now();
|
|
442
|
+
logger.log(
|
|
443
|
+
LogSource.Internals,
|
|
444
|
+
'SEND_LOG_IMMEDIATELY',
|
|
419
445
|
'_stopRecording Error',
|
|
420
|
-
|
|
446
|
+
{
|
|
447
|
+
error: err,
|
|
448
|
+
startReqTs,
|
|
449
|
+
endReqTs,
|
|
450
|
+
latency: endReqTs - startReqTs,
|
|
451
|
+
requestId,
|
|
452
|
+
},
|
|
421
453
|
);
|
|
422
454
|
setInProgress(false);
|
|
423
455
|
log('stop recording', err);
|
|
@@ -480,6 +512,8 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
480
512
|
|
|
481
513
|
const fetchRecordings = useCallback(
|
|
482
514
|
(page: number) => {
|
|
515
|
+
const requestId = getUniqueID();
|
|
516
|
+
const startReqTs = Date.now();
|
|
483
517
|
logger.log(
|
|
484
518
|
LogSource.NetworkRest,
|
|
485
519
|
'recordings_get',
|
|
@@ -488,6 +522,8 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
488
522
|
passphrase: roomId?.host,
|
|
489
523
|
limit: 10,
|
|
490
524
|
page,
|
|
525
|
+
requestId,
|
|
526
|
+
startReqTs,
|
|
491
527
|
},
|
|
492
528
|
);
|
|
493
529
|
return fetch(`${$config.BACKEND_ENDPOINT}/v1/recordings`, {
|
|
@@ -495,7 +531,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
495
531
|
headers: {
|
|
496
532
|
'Content-Type': 'application/json',
|
|
497
533
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
498
|
-
'X-Request-Id':
|
|
534
|
+
'X-Request-Id': requestId,
|
|
499
535
|
},
|
|
500
536
|
body: JSON.stringify({
|
|
501
537
|
passphrase: roomId?.host,
|
|
@@ -503,13 +539,20 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
503
539
|
page,
|
|
504
540
|
}),
|
|
505
541
|
}).then(async response => {
|
|
542
|
+
const endReqTs = Date.now();
|
|
506
543
|
const data = await response.json();
|
|
507
544
|
if (response.ok) {
|
|
508
545
|
logger.log(
|
|
509
546
|
LogSource.NetworkRest,
|
|
510
547
|
'recordings_get',
|
|
511
548
|
'fetch recordings successfull',
|
|
512
|
-
|
|
549
|
+
{
|
|
550
|
+
responseData: data,
|
|
551
|
+
startReqTs,
|
|
552
|
+
endReqTs,
|
|
553
|
+
latency: endReqTs - startReqTs,
|
|
554
|
+
requestId,
|
|
555
|
+
},
|
|
513
556
|
);
|
|
514
557
|
if (data) {
|
|
515
558
|
return data;
|
|
@@ -528,7 +571,13 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
528
571
|
LogSource.NetworkRest,
|
|
529
572
|
'recordings_get',
|
|
530
573
|
'Error while fetching recording',
|
|
531
|
-
|
|
574
|
+
{
|
|
575
|
+
error,
|
|
576
|
+
startReqTs,
|
|
577
|
+
endReqTs,
|
|
578
|
+
latency: endReqTs - startReqTs,
|
|
579
|
+
requestId,
|
|
580
|
+
},
|
|
532
581
|
);
|
|
533
582
|
return Promise.reject(error);
|
|
534
583
|
}
|
|
@@ -636,7 +685,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
636
685
|
case RecordingActions.REQUEST_TO_STOP_RECORDING:
|
|
637
686
|
logger.log(
|
|
638
687
|
LogSource.Internals,
|
|
639
|
-
'
|
|
688
|
+
'SEND_LOG_IMMEDIATELY',
|
|
640
689
|
'recording_state -> REQUEST_TO_STOP_RECORDING',
|
|
641
690
|
);
|
|
642
691
|
_stopRecording('bot');
|
|
@@ -32,13 +32,17 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => {
|
|
|
32
32
|
data: {roomId, isHost},
|
|
33
33
|
} = useRoomInfo();
|
|
34
34
|
|
|
35
|
-
const apiCall = async (
|
|
35
|
+
const apiCall = async (
|
|
36
|
+
method: 'request' | 'approval',
|
|
37
|
+
payload: string,
|
|
38
|
+
requestId: string,
|
|
39
|
+
) => {
|
|
36
40
|
const response = await fetch(`${WAITING_ROOM_URL}/${method}`, {
|
|
37
41
|
method: 'POST',
|
|
38
42
|
headers: {
|
|
39
43
|
'Content-Type': 'application/json',
|
|
40
44
|
authorization: store.token ? `Bearer ${store.token}` : '',
|
|
41
|
-
'X-Request-Id':
|
|
45
|
+
'X-Request-Id': requestId,
|
|
42
46
|
},
|
|
43
47
|
body: payload,
|
|
44
48
|
});
|
|
@@ -52,18 +56,27 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => {
|
|
|
52
56
|
passphrase: meetingPhrase || phrase,
|
|
53
57
|
send_event: send_event,
|
|
54
58
|
});
|
|
59
|
+
const requestId = getUniqueID();
|
|
60
|
+
const startReqTs = Date.now();
|
|
55
61
|
logger.log(
|
|
56
62
|
LogSource.NetworkRest,
|
|
57
63
|
'channel_join_request',
|
|
58
64
|
'API channel_join_request trying to send request to join channel',
|
|
59
|
-
payload,
|
|
65
|
+
{payload, startReqTs, requestId},
|
|
60
66
|
);
|
|
61
|
-
const res = await apiCall('request', payload);
|
|
67
|
+
const res = await apiCall('request', payload, requestId);
|
|
68
|
+
const endReqTs = Date.now();
|
|
62
69
|
logger.log(
|
|
63
70
|
LogSource.NetworkRest,
|
|
64
71
|
'channel_join_request',
|
|
65
72
|
'API channel_join_request executed successfully',
|
|
66
|
-
|
|
73
|
+
{
|
|
74
|
+
responseData: res,
|
|
75
|
+
requestId,
|
|
76
|
+
startReqTs,
|
|
77
|
+
endReqTs,
|
|
78
|
+
latency: endReqTs - startReqTs,
|
|
79
|
+
},
|
|
67
80
|
);
|
|
68
81
|
return res;
|
|
69
82
|
};
|
|
@@ -81,18 +94,27 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => {
|
|
|
81
94
|
attendee_screenshare_uid: attendee_screenshare_uid, // screenshare uid of attendee
|
|
82
95
|
approved: approved, //approval status,
|
|
83
96
|
});
|
|
97
|
+
const requestId = getUniqueID();
|
|
98
|
+
const startReqTs = Date.now();
|
|
84
99
|
logger.log(
|
|
85
100
|
LogSource.NetworkRest,
|
|
86
101
|
'channel_join_approval',
|
|
87
102
|
`API channel_join_approval. Trying to approve join channel request as waiting room is enabled. Is request approved ? ${approved}`,
|
|
88
|
-
payload,
|
|
103
|
+
{payload, requestId, startReqTs},
|
|
89
104
|
);
|
|
90
|
-
const res = await apiCall('approval', payload);
|
|
105
|
+
const res = await apiCall('approval', payload, requestId);
|
|
106
|
+
const endReqTs = Date.now();
|
|
91
107
|
logger.log(
|
|
92
108
|
LogSource.NetworkRest,
|
|
93
109
|
'channel_join_request',
|
|
94
110
|
'API channel_join_approval executed successfully',
|
|
95
|
-
|
|
111
|
+
{
|
|
112
|
+
responseData: res,
|
|
113
|
+
requestId,
|
|
114
|
+
startReqTs,
|
|
115
|
+
endReqTs,
|
|
116
|
+
latency: endReqTs - startReqTs,
|
|
117
|
+
},
|
|
96
118
|
);
|
|
97
119
|
return res;
|
|
98
120
|
};
|
|
@@ -15,9 +15,13 @@ import {
|
|
|
15
15
|
useWindowDimensions,
|
|
16
16
|
} from 'react-native';
|
|
17
17
|
import Platform from '../subComponents/Platform';
|
|
18
|
-
|
|
19
18
|
import * as ReactIs from 'react-is';
|
|
20
19
|
|
|
20
|
+
const getSessionId = () => {
|
|
21
|
+
const {logger} = require('../logger/AppBuilderLogger');
|
|
22
|
+
return logger.getSessionId();
|
|
23
|
+
};
|
|
24
|
+
|
|
21
25
|
const trimText = (text: string, length: number = 25) => {
|
|
22
26
|
if (!text) {
|
|
23
27
|
return '';
|
|
@@ -324,6 +328,7 @@ const updateToolbarDefaultConfig = (data, defaultItemsConfig) => {
|
|
|
324
328
|
};
|
|
325
329
|
|
|
326
330
|
export {
|
|
331
|
+
getSessionId,
|
|
327
332
|
updateToolbarDefaultConfig,
|
|
328
333
|
useIsDesktop,
|
|
329
334
|
useIsSmall,
|
|
@@ -4,6 +4,7 @@ import {useSetRoomInfo} from '../components/room-info/useSetRoomInfo';
|
|
|
4
4
|
import SDKEvents from '../utils/SdkEvents';
|
|
5
5
|
import isSDK from './isSDK';
|
|
6
6
|
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
7
|
+
import getUniqueID from './getUniqueID';
|
|
7
8
|
|
|
8
9
|
const CREATE_CHANNEL = gql`
|
|
9
10
|
mutation CreateChannel($title: String!, $enablePSTN: Boolean) {
|
|
@@ -37,6 +38,8 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
37
38
|
//isSeparateHostLink will be for internal usage since backend integration is not there
|
|
38
39
|
isSeparateHostLink?: boolean,
|
|
39
40
|
) => {
|
|
41
|
+
const requestId = getUniqueID();
|
|
42
|
+
const startReqTs = Date.now();
|
|
40
43
|
logger.log(
|
|
41
44
|
LogSource.NetworkRest,
|
|
42
45
|
'createChannel',
|
|
@@ -45,14 +48,23 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
45
48
|
roomTitle,
|
|
46
49
|
enablePSTN,
|
|
47
50
|
isSeparateHostLink,
|
|
51
|
+
startReqTs,
|
|
52
|
+
requestId,
|
|
48
53
|
},
|
|
49
54
|
);
|
|
50
55
|
const res = await createChannel({
|
|
56
|
+
context: {
|
|
57
|
+
headers: {
|
|
58
|
+
'X-Request-Id': requestId,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
51
61
|
variables: {
|
|
52
62
|
title: roomTitle,
|
|
53
63
|
enablePSTN: enablePSTN,
|
|
54
64
|
},
|
|
55
65
|
});
|
|
66
|
+
const endReqTs = Date.now();
|
|
67
|
+
const latency = endReqTs - startReqTs;
|
|
56
68
|
// in React-SDK mode, we use a more recent package of @apollo/client
|
|
57
69
|
// which is compatible with react18, long term we should be looking to
|
|
58
70
|
// upgrade core dependency as well. The following condition accounts
|
|
@@ -62,16 +74,23 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
62
74
|
LogSource.NetworkRest,
|
|
63
75
|
'createChannel',
|
|
64
76
|
'API createChannel failed. There was an error',
|
|
65
|
-
error,
|
|
77
|
+
{error, startReqTs, endReqTs, latency: latency, requestId},
|
|
66
78
|
);
|
|
67
79
|
throw error;
|
|
68
80
|
}
|
|
81
|
+
|
|
69
82
|
if (res && res?.data && res?.data?.createChannel) {
|
|
70
83
|
logger.log(
|
|
71
84
|
LogSource.NetworkRest,
|
|
72
85
|
'createChannel',
|
|
73
86
|
'API createChannel. Channel created successfully',
|
|
74
|
-
|
|
87
|
+
{
|
|
88
|
+
responseData: res.data.createChannel,
|
|
89
|
+
startReqTs,
|
|
90
|
+
endReqTs,
|
|
91
|
+
latency: latency,
|
|
92
|
+
requestId,
|
|
93
|
+
},
|
|
75
94
|
);
|
|
76
95
|
let roomInfo: Partial<RoomInfoContextInterface['data']> = {
|
|
77
96
|
roomId: {
|
|
@@ -34,8 +34,20 @@ const useFindActiveSpeaker = () => {
|
|
|
34
34
|
const activeSpeakerUid = useRef(undefined);
|
|
35
35
|
|
|
36
36
|
const emitActiveSpeaker = (uid: UidType) => {
|
|
37
|
+
const timenow = Date.now();
|
|
37
38
|
if (uid !== activeSpeakerUid.current) {
|
|
38
39
|
activeSpeakerUid.current = uid;
|
|
40
|
+
uid
|
|
41
|
+
? logger.log(
|
|
42
|
+
LogSource.Internals,
|
|
43
|
+
'ACTIVE_SPEAKER',
|
|
44
|
+
`${'Final Active speaker - '} ${uid}`,
|
|
45
|
+
{
|
|
46
|
+
timestamp: timenow,
|
|
47
|
+
uid: uid,
|
|
48
|
+
},
|
|
49
|
+
)
|
|
50
|
+
: {};
|
|
39
51
|
LocalEventEmitter.emit(LocalEventsEnum.ACTIVE_SPEAKER, uid);
|
|
40
52
|
}
|
|
41
53
|
};
|
|
@@ -131,11 +143,6 @@ const useFindActiveSpeaker = () => {
|
|
|
131
143
|
);
|
|
132
144
|
if (!speakingUids || speakingUids?.length == 0) {
|
|
133
145
|
log(' %cFinal No Active speaker', 'color:red');
|
|
134
|
-
logger.log(
|
|
135
|
-
LogSource.Internals,
|
|
136
|
-
'ACTIVE_SPEAKER',
|
|
137
|
-
`${'%cFinal No Active speaker'}, ${'color:red'}`,
|
|
138
|
-
);
|
|
139
146
|
emitActiveSpeaker(0);
|
|
140
147
|
} else {
|
|
141
148
|
if (speakingUids?.length === 1) {
|
|
@@ -3,6 +3,8 @@ import {gql} from '@apollo/client';
|
|
|
3
3
|
import {RoomInfoContextInterface} from '../components/room-info/useRoomInfo';
|
|
4
4
|
import {useSetRoomInfo} from '../components/room-info/useSetRoomInfo';
|
|
5
5
|
import {GraphQLContext} from '../components/GraphQLProvider';
|
|
6
|
+
import getUniqueID from './getUniqueID';
|
|
7
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
6
8
|
|
|
7
9
|
const SHARE = gql`
|
|
8
10
|
query share($passphrase: String!) {
|
|
@@ -25,15 +27,56 @@ export default function useGetMeetingPhrase() {
|
|
|
25
27
|
const {setRoomInfo} = useSetRoomInfo();
|
|
26
28
|
const {client} = useContext(GraphQLContext);
|
|
27
29
|
return async (phrase: string) => {
|
|
30
|
+
const requestId = getUniqueID();
|
|
31
|
+
const startReqTs = Date.now();
|
|
32
|
+
logger.log(
|
|
33
|
+
LogSource.Internals,
|
|
34
|
+
'GET_MEETING_PHRASE',
|
|
35
|
+
'Query Trying request to meeting phrase details',
|
|
36
|
+
{
|
|
37
|
+
requestId,
|
|
38
|
+
startReqTs,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
28
41
|
const response = await client.query({
|
|
42
|
+
context: {
|
|
43
|
+
headers: {
|
|
44
|
+
'X-Request-Id': requestId,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
29
47
|
query: SHARE,
|
|
30
48
|
variables: {
|
|
31
49
|
passphrase: phrase,
|
|
32
50
|
},
|
|
33
51
|
});
|
|
52
|
+
const endReqTs = Date.now();
|
|
34
53
|
if (response.error) {
|
|
54
|
+
logger.error(
|
|
55
|
+
LogSource.Internals,
|
|
56
|
+
'GET_MEETING_PHRASE',
|
|
57
|
+
'Query GET_MEETING_PHRASE failed',
|
|
58
|
+
{
|
|
59
|
+
error: response.error,
|
|
60
|
+
requestId,
|
|
61
|
+
startReqTs,
|
|
62
|
+
endReqTs,
|
|
63
|
+
latency: endReqTs - startReqTs,
|
|
64
|
+
},
|
|
65
|
+
);
|
|
35
66
|
throw response.error;
|
|
36
67
|
} else {
|
|
68
|
+
logger.log(
|
|
69
|
+
LogSource.Internals,
|
|
70
|
+
'GET_MEETING_PHRASE',
|
|
71
|
+
'Query GET_MEETING_PHRASE success',
|
|
72
|
+
{
|
|
73
|
+
responseData: response,
|
|
74
|
+
requestId,
|
|
75
|
+
startReqTs,
|
|
76
|
+
endReqTs,
|
|
77
|
+
latency: endReqTs - startReqTs,
|
|
78
|
+
},
|
|
79
|
+
);
|
|
37
80
|
try {
|
|
38
81
|
if (response && response.data) {
|
|
39
82
|
let data = response.data;
|
|
@@ -52,7 +95,7 @@ export default function useGetMeetingPhrase() {
|
|
|
52
95
|
pin: data.share.pstn.dtmf,
|
|
53
96
|
};
|
|
54
97
|
}
|
|
55
|
-
setRoomInfo(
|
|
98
|
+
setRoomInfo(prevState => {
|
|
56
99
|
return {
|
|
57
100
|
...prevState,
|
|
58
101
|
data: {
|