Skip to content

Commit

Permalink
fix: setting up linter engine after consolidated API is finished (#33049
Browse files Browse the repository at this point in the history
)

## Description
windowMessageListener is throwing linting error saying
`windowMessageListener is not defined` because it is missing from global
data which gets created as part of linter.

windowMessageListener is added based on
`license_message_listener_enabled` feature flag. consolidated API sends
all feature flags and as we are setting up linter engine before
consolidated api is finished, it takes default value of feature flag
from redux store. We don't update these feature flag values again
leaving linter to have stale values ie
`license_message_listener_enabled: false`.

this fix ensures that linter set up is called after consolidated api is
finished to get updated values for feature flags

Fixes # #32126
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8908838242>
> Commit: c4cd0d6
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8908838242&attempt=3"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->





























## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
  • Loading branch information
ApekshaBhosale committed May 1, 2024
1 parent c37aa0a commit 841b9f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/client/src/ce/constants/ReduxActionConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ const ActionTypes = {
SET_BUILDING_BLOCK_DRAG_START_TIME: "SET_BUILDING_BLOCK_DRAG_START_TIME",
RESET_BUILDING_BLOCK_DRAG_START_TIME: "RESET_BUILDING_BLOCK_DRAG_START_TIME",
CLOSE_QUERY_ACTION_TAB_SUCCESS: "CLOSE_QUERY_ACTION_TAB_SUCCESS",
LINT_SETUP: "LINT_SETUP",
};

export const ReduxActionTypes = {
Expand Down
1 change: 1 addition & 0 deletions app/client/src/sagas/InitSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export function* startAppEngine(action: ReduxAction<AppEnginePayload>) {
const allResponses: InitConsolidatedApi = yield call(getInitResponses, {
...action.payload,
});
yield put({ type: ReduxActionTypes.LINT_SETUP });
const { applicationId, toLoadPageId } = yield call(
engine.loadAppData,
action.payload,
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/LintingSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function* initiateLinting(

export default function* lintTreeSagaWatcher() {
yield takeEvery(ReduxActionTypes.UPDATE_LINT_GLOBALS, updateLintGlobals);
yield takeEvery(ReduxActionTypes.START_EVALUATION, setupSaga);
yield takeEvery(ReduxActionTypes.LINT_SETUP, setupSaga);
}

export function* setupSaga(): any {
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/sagas/__tests__/initSagas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ describe("tests the sagas in initSagas", () => {
.next()
.call(getInitResponses, { ...action.payload })
.next(mockResponse.data)
.put({ type: ReduxActionTypes.LINT_SETUP })
.next()
.call(engine.loadAppData, action.payload, mockResponse.data)
.next({
applicationId: action.payload.applicationId,
Expand Down

0 comments on commit 841b9f9

Please sign in to comment.