Skip to content

Commit

Permalink
EPMRPP-91264 || Extra llocation request is sent for error log messages (
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-hambardzumian authored Jul 2, 2024
1 parent fb311c1 commit acdf02f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/controllers/log/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
} from 'controllers/log/nestedSteps/actionCreators';
import { createNamespacedQuery } from 'common/utils/routingUtils';
import { FAILED } from 'common/constants/testStatuses';
import { ERROR } from 'common/constants/logLevels';
import { ERROR, FATAL } from 'common/constants/logLevels';
import {
fetchErrorLogs,
clearLogPageStackTrace,
Expand Down Expand Up @@ -130,17 +130,19 @@ function* fetchAllErrorLogs({
excludeLogContent = true,
level,
}) {
const logMessages = yield select(logItemsSelector);
const requiresErrorLogLocation = logMessages.some((log) => [ERROR, FATAL].includes(log.level));

const { id } = logItem;
const { activeProject, query, filterLevel } = yield call(collectLogPayload);
let retryId = null;
const logViewMode = yield select(logViewModeSelector);
if (logViewMode === DETAILED_LOG_VIEW) {
retryId = yield select(activeRetryIdSelector);
}
const isDebugMode = yield select(debugModeSelector);
let cancelRequest = () => {};
try {
if (!isDebugMode) {
if (requiresErrorLogLocation) {
yield put(
fetchDataAction(namespace)(
URLS.errorLogs(activeProject, retryId || id, level || filterLevel),
Expand Down Expand Up @@ -383,7 +385,6 @@ function* fetchLogPageData({ meta = {} }) {
put(fetchTestItemsAction({ offset })),
put(fetchLogPageStackTrace(logItem)),
put(fetchFirstAttachmentsAction()),
put(fetchErrorLogs(logItem)),
call(fetchLogs),
]);
return;
Expand Down

0 comments on commit acdf02f

Please sign in to comment.