Skip to content

chore: Remove websocket server on RTS#37827

Merged
sharat87 merged 1 commit intoreleasefrom
chore/no-socket
Nov 29, 2024
Merged

chore: Remove websocket server on RTS#37827
sharat87 merged 1 commit intoreleasefrom
chore/no-socket

Conversation

@sharat87
Copy link
Member

@sharat87 sharat87 commented Nov 29, 2024

Remove the websocket server on RTS. The RTS abbreviation has now completely lost significance. Let's now call it rts, in memory. 🙂

Automation

/test sanity

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12078784104
Commit: f858c99
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Fri, 29 Nov 2024 04:42:47 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Removed unnecessary socket-related dependencies and constants, streamlining the application.
  • New Features

    • Enhanced application performance by eliminating real-time communication features that were no longer necessary.
  • Chores

    • Cleaned up the codebase by removing outdated socket management files and constants, simplifying the overall architecture.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2024

Walkthrough

The pull request involves significant modifications to the appsmith-rts project, primarily focusing on the removal of socket-related functionalities. This includes the deletion of the socket.io dependency from package.json, the removal of constants and functions related to socket communication in several files, and the elimination of a middleware for socket authentication. The overall architecture remains intact, but the real-time collaborative features relying on socket connections have been removed.

Changes

File Path Change Summary
app/client/packages/rts/package.json Removed socket.io dependency from dependencies.
app/client/packages/rts/src/constants/routes.ts Removed export of constant RTS_BASE_PATH.
app/client/packages/rts/src/constants/socket.ts Removed constants related to socket communication: APP_ROOM_PREFIX, PAGE_ROOM_PREFIX, ROOT_NAMESPACE, PAGE_EDIT_NAMESPACE, EDITORS_EVENT_NAME, START_EDIT_EVENT_NAME, LEAVE_EDIT_EVENT_NAME, MOUSE_POINTER_EVENT_NAME, RELEASE_VERSION_EVENT_NAME, PAGE_VISIBILITY_EVENT_NAME.
app/client/packages/rts/src/controllers/socket.ts Removed functions for socket management: subscribeToEditEvents, onAppSocketConnected, onPageSocketConnected, tryAuthAndJoinPendingRoom, joinEditRoom, findPolicyEmails, sendCurrentUsers.
app/client/packages/rts/src/middlewares/socket-auth.ts Removed middleware function tryAuth.
app/client/packages/rts/src/server.ts Removed import of Server from socket.io, removed socket server initialization, and removed import of RTS_BASE_PATH.
app/client/packages/rts/src/sockets/events.ts Removed function watchEvents.
app/client/packages/rts/src/sockets/index.ts Removed function initializeSockets.
app/client/packages/rts/src/utils/models.ts Removed classes and interface: AppUser, CurrentEditorsEvent, MousePointerEvent, and Policy.

Possibly related PRs

Suggested labels

Bug

Suggested reviewers

  • mohanarpit
  • ApekshaBhosale
  • pratapaprasanna
  • yatinappsmith

Poem

In the code where sockets once thrived,
Now silence reigns, the features deprived.
Constants and functions have bid adieu,
A simpler path, with less to construe.
Goodbye to the webs that once intertwined,
A new chapter starts, with clarity aligned! 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ff3909a and f858c99.

⛔ Files ignored due to path filters (1)
  • app/client/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • app/client/packages/rts/package.json (1 hunks)
  • app/client/packages/rts/src/constants/routes.ts (0 hunks)
  • app/client/packages/rts/src/constants/socket.ts (0 hunks)
  • app/client/packages/rts/src/controllers/socket.ts (0 hunks)
  • app/client/packages/rts/src/middlewares/socket-auth.ts (0 hunks)
  • app/client/packages/rts/src/server.ts (1 hunks)
  • app/client/packages/rts/src/sockets/events.ts (0 hunks)
  • app/client/packages/rts/src/sockets/index.ts (0 hunks)
  • app/client/packages/rts/src/utils/models.ts (0 hunks)
💤 Files with no reviewable changes (7)
  • app/client/packages/rts/src/constants/routes.ts
  • app/client/packages/rts/src/constants/socket.ts
  • app/client/packages/rts/src/controllers/socket.ts
  • app/client/packages/rts/src/middlewares/socket-auth.ts
  • app/client/packages/rts/src/sockets/events.ts
  • app/client/packages/rts/src/sockets/index.ts
  • app/client/packages/rts/src/utils/models.ts
🔇 Additional comments (5)
app/client/packages/rts/src/server.ts (3)

Line range hint 21-41: Clean server setup with proper security configurations

The Express server configuration follows best practices with:

  • Disabled x-powered-by header
  • Proper JSON body size limits
  • Well-organized route structure

Line range hint 37-38: Verify if these timeout values are optimal

The headersTimeout (61s) and keepAliveTimeout (60s) values are quite high for a typical HTTP server. While this might be intentional, it's worth confirming if these values are still appropriate after removing the websocket server.

Let's check if these values are consistent across the codebase:


13-13: LGTM! Clean import after websocket removal

The simplified import aligns well with the removal of websocket functionality.

Let's verify no lingering websocket references exist:

✅ Verification successful

Clean import confirmed - no lingering websocket references

The import of RTS_BASE_API_PATH is valid and consistent with the codebase. The constant is properly defined in routes.ts and there are no remaining socket.io references in the RTS package, confirming successful websocket removal.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining socket.io related code
rg -i "socket\.io|websocket|ws:|wss:" app/client/packages/rts/

Length of output: 64


Script:

#!/bin/bash
# Let's try a broader search for socket-related terms and WebSocket configurations
rg -i "socket|ws[s]?:|websocket" .

# Also search for any remaining RTS_BASE_PATH references
rg "RTS_BASE_PATH" .

# Check the constants file to verify the API path usage
fd -g "*routes*" -x cat {}

Length of output: 140967


Script:

#!/bin/bash
# Let's check the specific routes file and any references to RTS_BASE_PATH
fd -g '*routes.ts' -x cat {}

# Also check for any remaining RTS_BASE_PATH references in the codebase
rg -l "RTS_BASE_PATH" .

# Check for any socket.io related imports in the RTS package
rg -l "socket\.io" app/client/packages/rts/

Length of output: 12770

app/client/packages/rts/package.json (2)

Line range hint 1-48: LGTM - Socket.io dependency removed successfully

The removal of socket.io aligns with the PR objective of removing the websocket server functionality.


Line range hint 18-34: Verify no remaining websocket-related dependencies

Let's ensure there are no lingering websocket-related dependencies.

✅ Verification successful

No websocket-related dependencies found in the RTS package

The verification shows no direct or transitive websocket-related dependencies in the RTS package. The matches found in other package.json files are unrelated (browser configurations and AWS client dependencies).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining websocket-related dependencies in package.json files

# Search for websocket-related dependencies in all package.json files
rg -i "socket|ws|websocket" $(fd package.json)

# Check if any of the current dependencies have websocket as a subdependency
for pkg in $(jq -r '.dependencies | keys[]' app/client/packages/rts/package.json); do
  curl -s "https://registry.npmjs.org/$pkg/latest" | jq -r '.dependencies | keys[]' 2>/dev/null | grep -i "socket\|ws\|websocket" || true
done

Length of output: 5109


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Nov 29, 2024
@sharat87 sharat87 added the ok-to-test Required label for CI label Nov 29, 2024
@sharat87 sharat87 marked this pull request as ready for review November 29, 2024 07:38
@sharat87 sharat87 merged commit 1c344b7 into release Nov 29, 2024
@sharat87 sharat87 deleted the chore/no-socket branch November 29, 2024 09:06
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Dec 2, 2024
Remove the websocket server on RTS. The RTS abbreviation has now
completely lost significance. Let's now call it `rts`, in memory. 🙂


## 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/12078784104>
> Commit: f858c99
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12078784104&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Fri, 29 Nov 2024 04:42:47 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

- **Bug Fixes**
- Removed unnecessary socket-related dependencies and constants,
streamlining the application.

- **New Features**
- Enhanced application performance by eliminating real-time
communication features that were no longer necessary.

- **Chores**
- Cleaned up the codebase by removing outdated socket management files
and constants, simplifying the overall architecture.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants