diff --git a/package-lock.json b/package-lock.json index 6ae0d30a7..08bfadd74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "agora-appbuilder-core", - "version": "4.0.28", + "version": "4.0.28-2", "lockfileVersion": 1 } diff --git a/package.json b/package.json index 0488ebfe7..57a3d76bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agora-appbuilder-core", - "version": "4.0.28", + "version": "4.0.28-2", "description": "React Native template for RTE app builder", "main": "index.js", "files": [ @@ -9,7 +9,7 @@ ], "scripts": { "vercel-build": "npm run dev-setup && cd template && npm run web:build && cd .. && npm run copy-vercel", - "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", + "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", "deps": "cd template && npm i --force", "dev-setup": "npm run uikit && npm run deps && node devSetup.js", "web-build": "cd template && npm run web:build && cd .. && npm run copy-vercel", diff --git a/template/customization-api/utils.ts b/template/customization-api/utils.ts index 46b7fa9aa..f982b992d 100644 --- a/template/customization-api/utils.ts +++ b/template/customization-api/utils.ts @@ -43,7 +43,6 @@ export {useString} from '../src/utils/useString'; export type {LanguageType} from '../src/subComponents/caption/utils'; export {default as useSpeechToText} from '../src/utils/useSpeechToText'; export {isMobileUA} from '../src/utils/common'; -export {getSessionId} from '../src/utils/common'; export {default as ThemeConfig} from '../src/theme'; export {default as hexadecimalTransparency} from '../src/utils/hexadecimalTransparency'; export {useFullScreen} from '../src/utils/useFullScreen'; diff --git a/template/src/auth/AuthProvider.tsx b/template/src/auth/AuthProvider.tsx index 1cf107b49..79708587e 100644 --- a/template/src/auth/AuthProvider.tsx +++ b/template/src/auth/AuthProvider.tsx @@ -309,6 +309,7 @@ const AuthProvider = (props: AuthProviderProps) => { context: { headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, }); @@ -332,6 +333,11 @@ const AuthProvider = (props: AuthProviderProps) => { 'user_details', 'API user details query failed. User is un-authenticated. Will Login in the user', { + networkError: { + name: error?.networkError?.name, + code: error?.networkError?.result?.error?.code, + message: error?.networkError?.result?.error?.message, + }, error, startReqTs, endRequestTs, @@ -515,6 +521,7 @@ const AuthProvider = (props: AuthProviderProps) => { credentials: 'include', headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }) .then(response => response.json()) diff --git a/template/src/auth/useIDPAuth.electron.tsx b/template/src/auth/useIDPAuth.electron.tsx index f3446970b..a219c5033 100644 --- a/template/src/auth/useIDPAuth.electron.tsx +++ b/template/src/auth/useIDPAuth.electron.tsx @@ -36,6 +36,7 @@ export const useIDPAuth = () => { headers: { authorization: store?.token ? `Bearer ${store?.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }) .then(response => response.json()) diff --git a/template/src/auth/useIDPAuth.native.tsx b/template/src/auth/useIDPAuth.native.tsx index d2c592bde..b0118950e 100644 --- a/template/src/auth/useIDPAuth.native.tsx +++ b/template/src/auth/useIDPAuth.native.tsx @@ -33,6 +33,7 @@ export const useIDPAuth = () => { headers: { authorization: store?.token ? `Bearer ${store?.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }) .then(response => response.json()) diff --git a/template/src/auth/useIDPAuth.tsx b/template/src/auth/useIDPAuth.tsx index ffd9fea5d..829dd1c14 100644 --- a/template/src/auth/useIDPAuth.tsx +++ b/template/src/auth/useIDPAuth.tsx @@ -31,6 +31,7 @@ export const useIDPAuth = () => { headers: { authorization: store?.token ? `Bearer ${store?.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }) .then(response => response.json()) diff --git a/template/src/auth/useTokenAuth.tsx b/template/src/auth/useTokenAuth.tsx index c29377f8e..28c89496c 100644 --- a/template/src/auth/useTokenAuth.tsx +++ b/template/src/auth/useTokenAuth.tsx @@ -57,6 +57,7 @@ const useTokenAuth = () => { authorization: store?.token ? `Bearer ${store.token}` : '', 'X-Platform-ID': getPlatformId(), 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }) .then(response => response.json()) @@ -213,6 +214,7 @@ const useTokenAuth = () => { ? `Bearer ${tokenRef.current}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, ) diff --git a/template/src/components/common/Error.tsx b/template/src/components/common/Error.tsx index 083345cf6..8f5d3b04b 100644 --- a/template/src/components/common/Error.tsx +++ b/template/src/components/common/Error.tsx @@ -16,6 +16,15 @@ import Error from '../../subComponents/Error'; type ErrorType = { name: string; message: string; + networkError?: { + name?: string; + result?: { + error?: { + code?: number; + message?: string; + }; + }; + }; }; type ErrorContextType = { error: ErrorType | undefined; @@ -46,12 +55,17 @@ const ErrorProvider = (props: {children: React.ReactNode}) => { const CommonError: React.FC = () => { const {error} = useContext(ErrorContext); useEffect(() => { - if (error?.name || error?.message) { + if ( + error?.networkError?.name || + error?.networkError?.result?.error?.message || + error?.name || + error?.message + ) { Toast.show({ leadingIconName: 'alert', type: 'error', - text1: error.name, - text2: error.message, + text1: error?.networkError?.name || error.name, + text2: error?.networkError?.result?.error?.message || error.message, visibilityTime: 1000 * 10, primaryBtn: null, secondaryBtn: null, diff --git a/template/src/components/popups/InvitePopup.tsx b/template/src/components/popups/InvitePopup.tsx index 85df69ca7..c2c6275e4 100644 --- a/template/src/components/popups/InvitePopup.tsx +++ b/template/src/components/popups/InvitePopup.tsx @@ -37,6 +37,7 @@ import { invitePopupHeading, } from '../../language/default-labels/videoCallScreenLabels'; import {cancelText} from '../../language/default-labels/commonLabels'; +import {logger, LogSource} from '../../logger/AppBuilderLogger'; const InvitePopup = () => { const {setShowInvitePopup, showInvitePopup} = useVideoCall(); @@ -47,6 +48,21 @@ const InvitePopup = () => { const getMeeting = useGetMeetingPhrase(); useEffect(() => { getMeeting(phrase).catch(error => { + logger.error( + LogSource.Internals, + 'GET_MEETING_PHRASE', + 'unable to fetch meeting details', + error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + }, + ); setGlobalErrorMessage(error); }); }, [phrase]); diff --git a/template/src/components/useUserPreference.tsx b/template/src/components/useUserPreference.tsx index efa3e080d..5af72af15 100644 --- a/template/src/components/useUserPreference.tsx +++ b/template/src/components/useUserPreference.tsx @@ -116,6 +116,7 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => { context: { headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, variables: { @@ -145,6 +146,13 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => { 'ERROR, could not save the name', error, { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, startReqTs, endReqTs, latency: endReqTs - startReqTs, @@ -160,6 +168,13 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => { 'ERROR, could not save the name', error, { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, startReqTs, endReqTs, latency: endReqTs - startReqTs, diff --git a/template/src/components/whiteboard/WhiteboardToolBox.tsx b/template/src/components/whiteboard/WhiteboardToolBox.tsx index ff9772dce..36140a7eb 100644 --- a/template/src/components/whiteboard/WhiteboardToolBox.tsx +++ b/template/src/components/whiteboard/WhiteboardToolBox.tsx @@ -359,6 +359,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => { myHeaders2.append('Content-Type', 'application/json'); myHeaders2.append('Authorization', `Bearer ${store?.token}`); myHeaders2.append('X-Request-Id', requestId); + myHeaders2.append('X-Session-Id', logger.getSessionId()); const body = JSON.stringify({ resource_url: url, @@ -498,6 +499,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => { myHeaders2.append('Content-Type', 'application/json'); myHeaders2.append('Authorization', `Bearer ${store?.token}`); myHeaders2.append('X-Request-Id', requestId); + myHeaders2.append('X-Session-Id', logger.getSessionId()); const body = JSON.stringify({ resource_url: url, }); @@ -624,6 +626,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => { headers: { authorization: store?.token ? `Bearer ${store?.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }) .then(async res => { diff --git a/template/src/components/whiteboard/WhiteboardWidget.tsx b/template/src/components/whiteboard/WhiteboardWidget.tsx index 772ab0f9c..e98ef73ee 100644 --- a/template/src/components/whiteboard/WhiteboardWidget.tsx +++ b/template/src/components/whiteboard/WhiteboardWidget.tsx @@ -148,6 +148,7 @@ const WhiteboardWidget = ({whiteboardRoom}) => { myHeaders2.append('Content-Type', 'application/json'); myHeaders2.append('Authorization', `Bearer ${store?.token}`); myHeaders2.append('X-Request-Id', requestId); + myHeaders2.append('X-Session-Id', logger.getSessionId()); const body = JSON.stringify({ room_uuid: room_uuid, path: '/init', diff --git a/template/src/pages/Create.tsx b/template/src/pages/Create.tsx index 04a48b7f6..a58ee42a7 100644 --- a/template/src/pages/Create.tsx +++ b/template/src/pages/Create.tsx @@ -212,6 +212,15 @@ const Create = () => { 'CREATE_MEETING', 'There was error while creating meeting', error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + }, ); if ( createRoomErrorToastHeadingText || diff --git a/template/src/pages/Join.tsx b/template/src/pages/Join.tsx index c0a3d65b4..076c0be68 100644 --- a/template/src/pages/Join.tsx +++ b/template/src/pages/Join.tsx @@ -130,6 +130,21 @@ const Join = () => { history.push(phrase); }) .catch(error => { + logger.error( + LogSource.Internals, + 'JOIN_MEETING', + 'Error on join room page', + error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + }, + ); const isInvalidUrl = error?.message.toLowerCase().trim() === 'invalid passphrase' || false; Toast.show({ diff --git a/template/src/pages/VideoCall.tsx b/template/src/pages/VideoCall.tsx index 4024bb698..d4f0a7e10 100644 --- a/template/src/pages/VideoCall.tsx +++ b/template/src/pages/VideoCall.tsx @@ -249,6 +249,21 @@ const VideoCall: React.FC = () => { useJoin(phrase, RoomInfoDefaultValue.roomPreference) .then(() => {}) .catch(error => { + logger.error( + LogSource.Internals, + 'JOIN_MEETING', + 'Join channel error', + error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + }, + ); setGlobalErrorMessage(error); history.push('/'); }); @@ -287,6 +302,21 @@ const VideoCall: React.FC = () => { setQueryComplete(false); currentMeetingPhrase.current = sdkMeetingPath; useJoin(sdkMeetingPhrase, preference).catch(error => { + logger.error( + LogSource.Internals, + 'JOIN_MEETING', + 'Join channel error', + error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + }, + ); setGlobalErrorMessage(error); history.push('/'); currentMeetingPhrase.current = ''; diff --git a/template/src/subComponents/caption/useSTTAPI.tsx b/template/src/subComponents/caption/useSTTAPI.tsx index 32ee1d847..d29de2fb9 100644 --- a/template/src/subComponents/caption/useSTTAPI.tsx +++ b/template/src/subComponents/caption/useSTTAPI.tsx @@ -65,6 +65,7 @@ const useSTTAPI = (): IuseSTTAPI => { 'Content-Type': 'application/json', authorization: store.token ? `Bearer ${store.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, body: JSON.stringify({ passphrase: roomId?.host || '', diff --git a/template/src/subComponents/recording/useRecording.tsx b/template/src/subComponents/recording/useRecording.tsx index 4a741ebe0..91fed29f2 100644 --- a/template/src/subComponents/recording/useRecording.tsx +++ b/template/src/subComponents/recording/useRecording.tsx @@ -273,6 +273,7 @@ const RecordingProvider = (props: RecordingProviderProps) => { 'Content-Type': 'application/json', authorization: store.token ? `Bearer ${store.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, body: JSON.stringify({ passphrase: roomId.host, @@ -355,7 +356,19 @@ const RecordingProvider = (props: RecordingProviderProps) => { 'recording_start', 'Error while start recording', err, - {startReqTs, endRequestTs, latency, requestId}, + { + networkError: { + name: err?.networkError?.name, + //@ts-ignore + code: err?.networkError?.result?.error?.code, + //@ts-ignore + message: err?.networkError?.result?.error?.message, + }, + startReqTs, + endRequestTs, + latency, + requestId, + }, ); setRecordingActive(false); setInProgress(false); @@ -404,6 +417,7 @@ const RecordingProvider = (props: RecordingProviderProps) => { 'Content-Type': 'application/json', authorization: store.token ? `Bearer ${store.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, body: JSON.stringify({ passphrase: roomId.host, @@ -547,6 +561,7 @@ const RecordingProvider = (props: RecordingProviderProps) => { 'Content-Type': 'application/json', authorization: store.token ? `Bearer ${store.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, body: JSON.stringify({ passphrase: roomId?.host, diff --git a/template/src/subComponents/recording/useRecordingLayoutQuery.tsx b/template/src/subComponents/recording/useRecordingLayoutQuery.tsx index e272eaa4f..f1c2bb023 100644 --- a/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +++ b/template/src/subComponents/recording/useRecordingLayoutQuery.tsx @@ -3,6 +3,8 @@ import {useParams} from '../../components/Router'; import {gql, useMutation} from '@apollo/client'; import {UidType} from '../../../agora-rn-uikit'; +import {logger, LogSource} from '../../logger/AppBuilderLogger'; +import getUniqueID from '../../utils/getUniqueID'; const SET_PRESENTER = gql` mutation setPresenter($uid: Int!, $passphrase: String!) { @@ -29,25 +31,88 @@ function useRecordingLayoutQuery() { * https://docs.agora.io/en/cloud-recording/cloud_recording_layout?platform=RESTful */ const executePresenterQuery = (screenShareUid: UidType) => { + const requestId = getUniqueID(); + const startReqTs = Date.now(); setPresenterQuery({ variables: { uid: screenShareUid, passphrase: phrase, }, + context: { + headers: { + 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), + }, + }, }) - .then((res) => { - if (res.data.setPresenter === 'success') { + .then(res => { + if (res?.data?.setPresenter === 'success') { + const endReqTs = Date.now(); + logger.log( + LogSource.Internals, + 'RECORDING', + 'setPresenterQuery success', + { + responseData: res, + startReqTs, + endReqTs, + latency: endReqTs - startReqTs, + requestId, + }, + ); } }) - .catch((err) => { - console.log(err); + .catch(error => { + const endReqTs = Date.now(); + logger.error( + LogSource.Internals, + 'RECORDING', + 'setPresenterQuery failure', + error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + startReqTs, + endReqTs, + latency: endReqTs - startReqTs, + requestId, + }, + ); }); }; const executeNormalQuery = () => { - setNormalQuery({variables: {passphrase: phrase}}) - .then((res) => { - if (res.data.stopRecordingSession === 'success') { + const requestId = getUniqueID(); + const startReqTs = Date.now(); + setNormalQuery({ + variables: {passphrase: phrase}, + context: { + headers: { + 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), + }, + }, + }) + .then(res => { + if (res?.data?.stopRecordingSession === 'success') { + const endReqTs = Date.now(); + logger.log( + LogSource.Internals, + 'RECORDING', + 'executeNormalQuery success', + { + responseData: res, + startReqTs, + endReqTs, + latency: endReqTs - startReqTs, + requestId, + }, + ); // Once the backend sucessfuly stops recording, // send a control message to everbody in the channel indicating that cloud recording is now inactive. // sendControlMessage(controlMessageEnum.cloudRecordingUnactive); @@ -55,8 +120,27 @@ function useRecordingLayoutQuery() { // setScreenshareActive(false); } }) - .catch((err) => { - console.log(err); + .catch(error => { + const endReqTs = Date.now(); + logger.error( + LogSource.Internals, + 'RECORDING', + 'executeNormalQuery failure', + error, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + startReqTs, + endReqTs, + latency: endReqTs - startReqTs, + requestId, + }, + ); }); }; diff --git a/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts b/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts index f583e1abc..b7ee96930 100644 --- a/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +++ b/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts @@ -43,6 +43,7 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => { 'Content-Type': 'application/json', authorization: store.token ? `Bearer ${store.token}` : '', 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, body: payload, }); diff --git a/template/src/utils/common.tsx b/template/src/utils/common.tsx index 144b78b01..47ac08957 100644 --- a/template/src/utils/common.tsx +++ b/template/src/utils/common.tsx @@ -17,11 +17,6 @@ import { import Platform from '../subComponents/Platform'; import * as ReactIs from 'react-is'; -const getSessionId = () => { - const {logger} = require('../logger/AppBuilderLogger'); - return logger.getSessionId(); -}; - const trimText = (text: string, length: number = 25) => { if (!text) { return ''; @@ -386,7 +381,6 @@ function MergeMoreButtonFields(sourceArray, updateObject) { } export { - getSessionId, updateToolbarDefaultConfig, useIsDesktop, useIsSmall, diff --git a/template/src/utils/useCreateRoom.ts b/template/src/utils/useCreateRoom.ts index 1e46ca450..72be2a496 100644 --- a/template/src/utils/useCreateRoom.ts +++ b/template/src/utils/useCreateRoom.ts @@ -56,6 +56,7 @@ export default function useCreateRoom(): createRoomFun { context: { headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, variables: { @@ -75,7 +76,19 @@ export default function useCreateRoom(): createRoomFun { 'createChannel', 'API createChannel failed. There was an error', error, - {startReqTs, endReqTs, latency: latency, requestId}, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + startReqTs, + endReqTs, + latency: latency, + requestId, + }, ); throw error; } diff --git a/template/src/utils/useGetMeetingPhrase.ts b/template/src/utils/useGetMeetingPhrase.ts index e2551e898..8e4e9c6dd 100644 --- a/template/src/utils/useGetMeetingPhrase.ts +++ b/template/src/utils/useGetMeetingPhrase.ts @@ -42,6 +42,7 @@ export default function useGetMeetingPhrase() { context: { headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, query: SHARE, @@ -57,6 +58,13 @@ export default function useGetMeetingPhrase() { 'Query GET_MEETING_PHRASE failed', response.error, { + networkError: { + name: response?.error?.networkError?.name, + //@ts-ignore + code: response?.error?.networkError?.result?.error?.code, + //@ts-ignore + message: response?.error?.networkError?.result?.error?.message, + }, requestId, startReqTs, endReqTs, diff --git a/template/src/utils/useJoinRoom.ts b/template/src/utils/useJoinRoom.ts index e6706f4cc..a87ed4aae 100644 --- a/template/src/utils/useJoinRoom.ts +++ b/template/src/utils/useJoinRoom.ts @@ -128,6 +128,7 @@ export default function useJoinRoom() { context: { headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, query: @@ -149,8 +150,16 @@ export default function useJoinRoom() { `API ${ isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel' } failed.`, + 'Join Channel Failed', response?.error, { + networkError: { + name: response?.error?.networkError?.name, + //@ts-ignore + code: response?.error?.networkError?.result?.error?.code, + //@ts-ignore + message: response?.error?.networkError?.result?.error?.message, + }, startReqTs, endReqTs, latency, diff --git a/template/src/utils/useMutePSTN.ts b/template/src/utils/useMutePSTN.ts index 7df3262ed..6f24cdeb8 100644 --- a/template/src/utils/useMutePSTN.ts +++ b/template/src/utils/useMutePSTN.ts @@ -34,6 +34,7 @@ const useMutePSTN = () => { context: { headers: { 'X-Request-Id': requestId, + 'X-Session-Id': logger.getSessionId(), }, }, variables: { @@ -53,7 +54,19 @@ const useMutePSTN = () => { 'MUTE_PSTN', 'Mutation MUTE_PSTN success', error, - {startReqTs, endReqTs, latency: endReqTs - startReqTs, requestId}, + { + networkError: { + name: error?.networkError?.name, + //@ts-ignore + code: error?.networkError?.result?.error?.code, + //@ts-ignore + message: error?.networkError?.result?.error?.message, + }, + startReqTs, + endReqTs, + latency: endReqTs - startReqTs, + requestId, + }, ); throw error; } else {