Skip to content

Commit

Permalink
chore: Remove socket-io and websocket connections (#37784)
Browse files Browse the repository at this point in the history
We don't use the websocket connection for anything of consequence. This
PR removes it and the `socket-io` dependency from the client.

The RTS still has it, will be removed in a subsequent PR.

## Automation

/test sanity

### 🔍 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/12062399334>
> Commit: 4f018b1
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12062399334&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 28 Nov 2024 04:55:02 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **New Features**
	- None

- **Bug Fixes**
	- None

- **Refactor**
- Removed websocket and collaborative editing functionality, simplifying
the application architecture.
- Eliminated related constants, actions, reducers, and sagas to
streamline codebase.

- **Chores**
- Updated test configurations by removing references to websocket sagas.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
sharat87 authored Nov 28, 2024
1 parent 0f3593a commit a1c8cb6
Show file tree
Hide file tree
Showing 21 changed files with 1 addition and 707 deletions.
1 change: 0 additions & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
"showdown": "^1.9.1",
"simplebar-react": "^2.4.3",
"smartlook-client": "^8.0.0",
"socket.io-client": "^4.5.4",
"sql-formatter": "12.2.0",
"styled-components": "^5.3.6",
"tailwindcss": "^3.3.3",
Expand Down
78 changes: 0 additions & 78 deletions app/client/src/actions/appCollabActions.ts

This file was deleted.

8 changes: 0 additions & 8 deletions app/client/src/actions/pageVisibilityActions.ts

This file was deleted.

44 changes: 0 additions & 44 deletions app/client/src/actions/websocketActions.ts

This file was deleted.

24 changes: 0 additions & 24 deletions app/client/src/ce/constants/ReduxActionConstants.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import type { ERROR_CODES } from "ee/constants/ApiConstants";
import type { AffectedJSObjects } from "sagas/EvaluationsSagaUtils";

const WebsocketActions = {
WEBSOCKET_APP_LEVEL_WRITE_CHANNEL: "WEBSOCKET_APP_LEVEL_WRITE_CHANNEL",
WEBSOCKET_PAGE_LEVEL_WRITE_CHANNEL: "WEBSOCKET_PAGE_LEVEL_WRITE_CHANNEL",
INIT_APP_LEVEL_SOCKET_CONNECTION: "INIT_APP_LEVEL_SOCKET_CONNECTION",
INIT_PAGE_LEVEL_SOCKET_CONNECTION: "INIT_PAGE_LEVEL_SOCKET_CONNECTION",
SET_IS_APP_LEVEL_WEBSOCKET_CONNECTED: "SET_IS_APP_LEVEL_WEBSOCKET_CONNECTED",
SET_IS_PAGE_LEVEL_WEBSOCKET_CONNECTED:
"SET_IS_PAGE_LEVEL_WEBSOCKET_CONNECTED",
};

const ActionSelectorReduxActionTypes = {
EVALUATE_ACTION_SELECTOR_FIELD: "EVALUATE_ACTION_SELECTOR_FIELD",
SET_EVALUATED_ACTION_SELECTOR_FIELD: "SET_EVALUATED_ACTION_SELECTOR_FIELD",
Expand Down Expand Up @@ -307,18 +297,6 @@ const EvaluationActionErrorTypes = {
FAILED_CORRECTING_BINDING_PATHS: "FAILED_CORRECTING_BINDING_PATHS",
};

const AppCollabActionTypes = {
APP_COLLAB_SET_CONCURRENT_PAGE_EDITORS:
"APP_COLLAB_SET_CONCURRENT_PAGE_EDITORS",
APP_COLLAB_LIST_EDITORS: "APP_COLLAB_LIST_EDITORS",
APP_COLLAB_RESET_EDITORS: "APP_COLLAB_RESET_EDITORS",
APP_COLLAB_SET_EDITORS_POINTER_DATA: "APP_COLLAB_SET_EDITORS_POINTER_DATA",
APP_COLLAB_UNSET_EDITORS_POINTER_DATA:
"APP_COLLAB_UNSET_EDITORS_POINTER_DATA",
APP_COLLAB_RESET_EDITORS_POINTER_DATA:
"APP_COLLAB_RESET_EDITORS_POINTER_DATA",
};

const OmniSearchActionTypes = {
SET_SEARCH_FILTER_CONTEXT: "SET_SEARCH_FILTER_CONTEXT",
SET_GLOBAL_SEARCH_QUERY: "SET_GLOBAL_SEARCH_QUERY",
Expand Down Expand Up @@ -1280,7 +1258,6 @@ export const ReduxActionTypes = {
...AdminSettingsActionTypes,
...AnalyticsActionTypes,
...AIActionTypes,
...AppCollabActionTypes,
...ApplicationActionTypes,
...AppThemeActionsTypes,
...AppViewActionTypes,
Expand Down Expand Up @@ -1316,7 +1293,6 @@ export const ReduxActionTypes = {
...ThemeActionTypes,
...UserAuthActionTypes,
...UserProfileActionTypes,
...WebsocketActions,
...WidgetCanvasActionTypes,
...WidgetOperationsActionTypes,
...WorkspaceActionTypes,
Expand Down
4 changes: 0 additions & 4 deletions app/client/src/ce/reducers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import type { GlobalSearchReduxState } from "reducers/uiReducers/globalSearchRed
import type { ActionSelectorReduxState } from "reducers/uiReducers/actionSelectorReducer";
import type { ReleasesState } from "reducers/uiReducers/releasesReducer";
import type { LoadingEntitiesState } from "reducers/evaluationReducers/loadingEntitiesReducer";
import type { WebsocketReducerState } from "reducers/uiReducers/websocketReducer";
import type { DebuggerReduxState } from "reducers/uiReducers/debuggerReducer";
import type { TourReducerState } from "reducers/uiReducers/tourReducer";
import type { TableFilterPaneReduxState } from "reducers/uiReducers/tableFilterPaneReducer";
Expand All @@ -45,7 +44,6 @@ import type { JSCollectionDataState } from "ee/reducers/entityReducers/jsActions
import type { CanvasSelectionState } from "reducers/uiReducers/canvasSelectionReducer";
import type { JSObjectNameReduxState } from "reducers/uiReducers/jsObjectNameReducer";
import type { GitSyncReducerState } from "reducers/uiReducers/gitSyncReducer";
import type { AppCollabReducerState } from "reducers/uiReducers/appCollabReducer";
import type { CrudInfoModalReduxState } from "reducers/uiReducers/crudInfoModalReducer";
import type { FormEvaluationState } from "reducers/evaluationReducers/formEvaluationReducer";
import type { widgetReflow } from "reducers/uiReducers/reflowReducer";
Expand Down Expand Up @@ -121,14 +119,12 @@ export interface AppState {
onBoarding: OnboardingState;
globalSearch: GlobalSearchReduxState;
releases: ReleasesState;
websocket: WebsocketReducerState;
debugger: DebuggerReduxState;
tour: TourReducerState;
jsPane: JsPaneReduxState;
canvasSelection: CanvasSelectionState;
jsObjectName: JSObjectNameReduxState;
gitSync: GitSyncReducerState;
appCollab: AppCollabReducerState;
crudInfoModal: CrudInfoModalReduxState;
widgetReflow: widgetReflow;
appTheming: AppThemingState;
Expand Down
4 changes: 0 additions & 4 deletions app/client/src/ce/reducers/uiReducers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ import onBoardingReducer from "reducers/uiReducers/onBoardingReducer";
import globalSearchReducer from "reducers/uiReducers/globalSearchReducer";
import actionSelectorReducer from "reducers/uiReducers/actionSelectorReducer";
import releasesReducer from "reducers/uiReducers/releasesReducer";
import websocketReducer from "reducers/uiReducers/websocketReducer";
import debuggerReducer from "reducers/uiReducers/debuggerReducer";
import tourReducer from "reducers/uiReducers/tourReducer";
import tableFilterPaneReducer from "reducers/uiReducers/tableFilterPaneReducer";
import jsPaneReducer from "reducers/uiReducers/jsPaneReducer";
import appCollabReducer from "reducers/uiReducers/appCollabReducer";
import canvasSelectionReducer from "reducers/uiReducers/canvasSelectionReducer";
import gitSyncReducer from "reducers/uiReducers/gitSyncReducer";
import crudInfoModalReducer from "reducers/uiReducers/crudInfoModalReducer";
Expand Down Expand Up @@ -78,14 +76,12 @@ export const uiReducerObject = {
onBoarding: onBoardingReducer,
globalSearch: globalSearchReducer,
releases: releasesReducer,
websocket: websocketReducer,
debugger: debuggerReducer,
tour: tourReducer,
jsPane: jsPaneReducer,
jsObjectName: jsObjectNameReducer,
canvasSelection: canvasSelectionReducer,
gitSync: gitSyncReducer,
appCollab: appCollabReducer,
crudInfoModal: crudInfoModalReducer,
widgetReflow: widgetReflowReducer,
appTheming: appThemingReducer,
Expand Down
10 changes: 0 additions & 10 deletions app/client/src/ce/sagas/ApplicationSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ import {
deleteRecentAppEntities,
getEnableStartSignposting,
} from "utils/storage";
import {
reconnectAppLevelWebsocket,
reconnectPageLevelWebsocket,
} from "actions/websocketActions";
import { getFetchedWorkspaces } from "ee/selectors/workspaceSelectors";

import { fetchPluginFormConfigs, fetchPlugins } from "actions/pluginActions";
Expand Down Expand Up @@ -648,12 +644,6 @@ export function* createApplicationSaga(
basePageId: defaultPage?.baseId,
}),
);

// subscribe to newly created application
// users join rooms on connection, so reconnecting
// ensures user receives the updates in the app just created
yield put(reconnectAppLevelWebsocket());
yield put(reconnectPageLevelWebsocket());
}
}
} catch (error) {
Expand Down
4 changes: 0 additions & 4 deletions app/client/src/ce/sagas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import LintingSaga from "sagas/LintingSagas";
import modalSagas from "sagas/ModalSagas";
import onboardingSagas from "sagas/OnboardingSagas";
import pageSagas from "ee/sagas/PageSagas";
import PageVisibilitySaga from "sagas/PageVisibilitySagas";
import pluginSagas from "sagas/PluginSagas";
import queryPaneSagas from "sagas/QueryPaneSagas";
import replaySaga from "sagas/ReplaySaga";
Expand All @@ -42,7 +41,6 @@ import snapshotSagas from "sagas/SnapshotSagas";
import snipingModeSagas from "sagas/SnipingModeSagas";
import templateSagas from "sagas/TemplatesSagas";
import themeSagas from "sagas/ThemeSaga";
import websocketSagas from "sagas/WebsocketSagas/WebsocketSagas";
import actionExecutionChangeListeners from "sagas/WidgetLoadingSaga";
import widgetOperationSagas from "sagas/WidgetOperationSagas";
import oneClickBindingSaga from "sagas/OneClickBindingSaga";
Expand Down Expand Up @@ -83,7 +81,6 @@ export const sagas = [
actionExecutionChangeListeners,
formEvaluationChangeListener,
globalSearchSagas,
websocketSagas,
debuggerSagas,
saaSPaneSagas,
selectionCanvasSagas,
Expand All @@ -94,7 +91,6 @@ export const sagas = [
appThemingSaga,
NavigationSagas,
editorContextSagas,
PageVisibilitySaga,
AutoHeightSagas,
tenantSagas,
JSLibrarySaga,
Expand Down
7 changes: 0 additions & 7 deletions app/client/src/ce/sagas/userSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ import {
getCurrentUser,
getFeatureFlagsFetched,
} from "selectors/usersSelectors";
import {
initAppLevelSocketConnection,
initPageLevelSocketConnection,
} from "actions/websocketActions";
import {
getEnableStartSignposting,
getFirstTimeUserOnboardingApplicationIds,
Expand Down Expand Up @@ -181,9 +177,6 @@ export function* runUserSideEffectsSaga() {
);
}

yield put(initAppLevelSocketConnection());
yield put(initPageLevelSocketConnection());

if (currentUser.emptyInstance) {
history.replace(SETUP);
}
Expand Down
22 changes: 0 additions & 22 deletions app/client/src/constants/WebsocketConstants.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/client/src/constants/WidgetValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ export const DEDICATED_WORKER_GLOBAL_SCOPE_IDENTIFIERS = {
webkitRequestFileSystemSync: "webkitRequestFileSystemSync",
webkitResolveLocalFileSystemSyncURL: "webkitResolveLocalFileSystemSyncURL",
webkitResolveLocalFileSystemURL: "webkitResolveLocalFileSystemURL",
WebSocket: "WebSocket",
WebTransport: "WebTransport",
WebTransportBidirectionalStream: "WebTransportBidirectionalStream",
WebTransportDatagramDuplexStream: "WebTransportDatagramDuplexStream",
Expand Down
Loading

0 comments on commit a1c8cb6

Please sign in to comment.