Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Don't merge in Testing] Release/4.0.28-1 #565

Open
wants to merge 6 commits into
base: release/4.0.28
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -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",
Expand Down
1 change: 0 additions & 1 deletion template/customization-api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
7 changes: 7 additions & 0 deletions template/src/auth/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ const AuthProvider = (props: AuthProviderProps) => {
context: {
headers: {
'X-Request-Id': requestId,
'X-Session-Id': logger.getSessionId(),
},
},
});
Expand All @@ -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,
Expand Down Expand Up @@ -515,6 +521,7 @@ const AuthProvider = (props: AuthProviderProps) => {
credentials: 'include',
headers: {
'X-Request-Id': requestId,
'X-Session-Id': logger.getSessionId(),
},
})
.then(response => response.json())
Expand Down
1 change: 1 addition & 0 deletions template/src/auth/useIDPAuth.electron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions template/src/auth/useIDPAuth.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions template/src/auth/useIDPAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions template/src/auth/useTokenAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -213,6 +214,7 @@ const useTokenAuth = () => {
? `Bearer ${tokenRef.current}`
: '',
'X-Request-Id': requestId,
'X-Session-Id': logger.getSessionId(),
},
},
)
Expand Down
20 changes: 17 additions & 3 deletions template/src/components/common/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 16 additions & 0 deletions template/src/components/popups/InvitePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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]);
Expand Down
15 changes: 15 additions & 0 deletions template/src/components/useUserPreference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
context: {
headers: {
'X-Request-Id': requestId,
'X-Session-Id': logger.getSessionId(),
},
},
variables: {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions template/src/components/whiteboard/WhiteboardToolBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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 => {
Expand Down
1 change: 1 addition & 0 deletions template/src/components/whiteboard/WhiteboardWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 9 additions & 0 deletions template/src/pages/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
15 changes: 15 additions & 0 deletions template/src/pages/Join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
30 changes: 30 additions & 0 deletions template/src/pages/VideoCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('/');
});
Expand Down Expand Up @@ -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 = '';
Expand Down
1 change: 1 addition & 0 deletions template/src/subComponents/caption/useSTTAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
Expand Down
17 changes: 16 additions & 1 deletion template/src/subComponents/recording/useRecording.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading