chore: Parallellise fetch page call with actions, jsObject and plugins (#12537)
This commit is contained in:
parent
cfba555fe8
commit
b7aff3c38b
File diff suppressed because it is too large
Load Diff
|
|
@ -329,6 +329,7 @@ function* initializeEditorSaga(
|
||||||
yield all([
|
yield all([
|
||||||
call(initiateEditorActions, applicationId),
|
call(initiateEditorActions, applicationId),
|
||||||
call(initiatePluginsAndDatasources),
|
call(initiatePluginsAndDatasources),
|
||||||
|
call(populatePageDSLsSaga),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
AnalyticsUtil.logEvent("EDITOR_OPEN", {
|
AnalyticsUtil.logEvent("EDITOR_OPEN", {
|
||||||
|
|
@ -347,8 +348,6 @@ function* initializeEditorSaga(
|
||||||
PerformanceTracker.stopAsyncTracking(
|
PerformanceTracker.stopAsyncTracking(
|
||||||
PerformanceTransactionName.INIT_EDIT_APP,
|
PerformanceTransactionName.INIT_EDIT_APP,
|
||||||
);
|
);
|
||||||
|
|
||||||
yield call(populatePageDSLsSaga);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
Sentry.captureException(e);
|
Sentry.captureException(e);
|
||||||
|
|
@ -401,51 +400,30 @@ export function* initializeAppViewerSaga(
|
||||||
);
|
);
|
||||||
yield put({ type: ReduxActionTypes.START_EVALUATION });
|
yield put({ type: ReduxActionTypes.START_EVALUATION });
|
||||||
|
|
||||||
const resultOfPrimaryCalls: boolean = yield failFastApiCalls(
|
|
||||||
[fetchActionsForView({ applicationId })],
|
|
||||||
[ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS],
|
|
||||||
[ReduxActionErrorTypes.FETCH_ACTIONS_VIEW_MODE_ERROR],
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!resultOfPrimaryCalls) return;
|
|
||||||
|
|
||||||
const jsActionsCall: boolean = yield failFastApiCalls(
|
|
||||||
[fetchJSCollectionsForView({ applicationId })],
|
|
||||||
[ReduxActionTypes.FETCH_JS_ACTIONS_VIEW_MODE_SUCCESS],
|
|
||||||
[ReduxActionErrorTypes.FETCH_JS_ACTIONS_VIEW_MODE_ERROR],
|
|
||||||
);
|
|
||||||
if (!jsActionsCall) return;
|
|
||||||
|
|
||||||
const defaultPageId: string = yield select(getDefaultPageId);
|
const defaultPageId: string = yield select(getDefaultPageId);
|
||||||
const toLoadPageId: string = pageId || defaultPageId;
|
const toLoadPageId: string = pageId || defaultPageId;
|
||||||
|
|
||||||
yield call(initiateURLUpdate, toLoadPageId, APP_MODE.PUBLISHED, pageId);
|
yield call(initiateURLUpdate, toLoadPageId, APP_MODE.PUBLISHED, pageId);
|
||||||
|
|
||||||
if (toLoadPageId) {
|
const resultOfPrimaryCalls: boolean = yield failFastApiCalls(
|
||||||
yield put(fetchPublishedPage(toLoadPageId, true));
|
[
|
||||||
|
fetchActionsForView({ applicationId }),
|
||||||
|
fetchJSCollectionsForView({ applicationId }),
|
||||||
|
fetchPublishedPage(toLoadPageId, true),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS,
|
||||||
|
ReduxActionTypes.FETCH_JS_ACTIONS_VIEW_MODE_SUCCESS,
|
||||||
|
ReduxActionTypes.FETCH_PUBLISHED_PAGE_SUCCESS,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
ReduxActionErrorTypes.FETCH_ACTIONS_VIEW_MODE_ERROR,
|
||||||
|
ReduxActionErrorTypes.FETCH_JS_ACTIONS_VIEW_MODE_ERROR,
|
||||||
|
ReduxActionErrorTypes.FETCH_PUBLISHED_PAGE_ERROR,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
const resultOfFetchPage: {
|
if (!resultOfPrimaryCalls) return;
|
||||||
success: boolean;
|
|
||||||
failure: boolean;
|
|
||||||
} = yield race({
|
|
||||||
success: take(ReduxActionTypes.FETCH_PUBLISHED_PAGE_SUCCESS),
|
|
||||||
failure: take(ReduxActionErrorTypes.FETCH_PUBLISHED_PAGE_ERROR),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (resultOfFetchPage.failure) {
|
|
||||||
yield put({
|
|
||||||
type: ReduxActionTypes.SAFE_CRASH_APPSMITH_REQUEST,
|
|
||||||
payload: {
|
|
||||||
code: get(
|
|
||||||
resultOfFetchPage,
|
|
||||||
"failure.payload.error.code",
|
|
||||||
ERROR_CODES.SERVER_ERROR,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
yield put(fetchCommentThreadsInit());
|
yield put(fetchCommentThreadsInit());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user