Skip to content
Closed
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
11 changes: 6 additions & 5 deletions app/client/src/sagas/BatchSagas.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import _ from "lodash";
import { put, debounce, takeEvery, all } from "redux-saga/effects";
import { put } from "redux-saga/effects";
import type { ReduxAction } from "ee/constants/ReduxActionConstants";
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import { batchActionSuccess } from "actions/batchActions";
Expand Down Expand Up @@ -88,8 +89,8 @@ function* executeBatchSaga() {
}

export default function* root() {
yield all([
debounce(20, ReduxActionTypes.EXECUTE_BATCH, executeBatchSaga),
takeEvery(ReduxActionTypes.BATCHED_UPDATE, storeUpdatesSaga),
]);
// yield all([
// debounce(20, ReduxActionTypes.EXECUTE_BATCH, executeBatchSaga),
// takeEvery(ReduxActionTypes.BATCHED_UPDATE, storeUpdatesSaga),
// ]);
Comment on lines +92 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical: Batch processing mechanism is disabled

Commenting out the saga effects disables the entire batch processing mechanism. Without these effects:

  • executeBatchSaga won't process batched actions
  • storeUpdatesSaga won't handle incoming updates
  • Actions will accumulate in the batches array without being processed

Restore the saga effects or provide an alternative mechanism:

- // yield all([
- //   debounce(20, ReduxActionTypes.EXECUTE_BATCH, executeBatchSaga),
- //   takeEvery(ReduxActionTypes.BATCHED_UPDATE, storeUpdatesSaga),
- // ]);
+ yield all([
+   debounce(20, ReduxActionTypes.EXECUTE_BATCH, executeBatchSaga),
+   takeEvery(ReduxActionTypes.BATCHED_UPDATE, storeUpdatesSaga),
+ ]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// yield all([
// debounce(20, ReduxActionTypes.EXECUTE_BATCH, executeBatchSaga),
// takeEvery(ReduxActionTypes.BATCHED_UPDATE, storeUpdatesSaga),
// ]);
yield all([
debounce(20, ReduxActionTypes.EXECUTE_BATCH, executeBatchSaga),
takeEvery(ReduxActionTypes.BATCHED_UPDATE, storeUpdatesSaga),
]);

}
2 changes: 2 additions & 0 deletions app/client/src/utils/WorkerUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ export class GracefulWorkerService {
WebworkerSpanData | SpanAttributes
> = {};

// eslint-disable-next-line no-console
method === "EVAL_TREE" && console.log("*** evaluation");
Comment on lines +284 to +285
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace console.log with proper logging

Using console.log in production code is not recommended. Additionally, the log message lacks context and timestamp information.

Replace with proper logging:

- // eslint-disable-next-line no-console
- method === "EVAL_TREE" && console.log("*** evaluation");
+ method === "EVAL_TREE" && log.debug(`Starting evaluation for request ${messageId}`);

Committable suggestion skipped: line range outside the PR's diff.

try {
sendMessage.call(this._Worker, {
messageType: MessageType.REQUEST,
Expand Down