Skip to content

feat: Add WebSocket support for real-time updates#1404

Open
knoxiboy wants to merge 5 commits into
aryandas2911:mainfrom
knoxiboy:feature/issue-1305-websocket
Open

feat: Add WebSocket support for real-time updates#1404
knoxiboy wants to merge 5 commits into
aryandas2911:mainfrom
knoxiboy:feature/issue-1305-websocket

Conversation

@knoxiboy
Copy link
Copy Markdown
Contributor

@knoxiboy knoxiboy commented Jun 1, 2026

🐞 Description

Resolves #1305.
This PR introduces Socket.IO-based real-time updates so the frontend can automatically refresh tasks and routines when changes occur on the backend, ensuring a seamless collaborative experience.

💻 Expected Behavior

  • Socket.IO server initializes and handles per-user room messaging.
  • React \SocketProvider\ listens for \ ask-update\ and
    outine-update\ events to trigger UI refetches.
  • Added \connect_error\ handler to catch and log socket connection drops.

🖼️ Screenshots / Logs (if applicable)

N/A

✅ Checklist

  • Implemented backend Socket.io logic
  • Added frontend Socket.io context provider
  • Added error handling for dropped connections
  • Tested locally

Copilot AI review requested due to automatic review settings June 1, 2026 08:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Socket.IO-based real-time update propagation so the frontend can automatically refresh tasks/routines when changes occur on the backend.

Changes:

  • Introduces Socket.IO server initialization and per-user “room” messaging on the backend.
  • Adds a React SocketProvider + SocketContext on the frontend to listen for update events and trigger refetches.
  • Updates routine/task UIs/hooks to refetch on task-update / routine-update ticks.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
frontend/src/pages/RoutineBuilder.jsx Refetches routines when a socket-driven update tick changes.
frontend/src/pages/Dashboard.jsx Refetches routines when a socket-driven update tick changes.
frontend/src/main.jsx Wraps app in SocketProvider to enable socket context app-wide.
frontend/src/hooks/useTasks.js Refetches tasks when a socket-driven update tick changes.
frontend/src/context/SocketContext.jsx Adds Socket provider/context and client-side socket listeners.
frontend/package.json Adds socket.io-client dependency.
backend/utils/socket.js Adds Socket.IO server setup with basic CORS config and room-join event.
backend/src/server.js Switches to HTTP server + initializes Socket.IO, then listens via server.listen.
backend/package.json Adds socket.io dependency.
backend/controllers/taskController.js Emits task-update to the user room on task mutations.
backend/controllers/routineController.js Emits routine-update to the user room on routine mutations.
Files not reviewed (2)
  • backend/package-lock.json: Language not supported
  • frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/utils/socket.js
Comment thread frontend/src/context/SocketContext.jsx
Comment thread backend/controllers/taskController.js Outdated
Comment thread backend/controllers/routineController.js Outdated
Comment thread frontend/src/pages/RoutineBuilder.jsx Outdated
Comment thread frontend/src/hooks/useTasks.js Outdated
Comment thread frontend/src/pages/Dashboard.jsx Outdated
@knoxiboy knoxiboy requested a review from Copilot June 6, 2026 08:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 5 comments.

Files not reviewed (2)
  • backend/package-lock.json: Language not supported
  • frontend/package-lock.json: Language not supported

Comment thread backend/utils/socket.js
Comment thread frontend/src/pages/RoutineBuilder.jsx Outdated
Comment thread frontend/src/pages/Dashboard.jsx Outdated
Comment thread frontend/src/hooks/useTasks.js Outdated
Comment thread frontend/src/context/SocketContext.jsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add WebSocket support for real-time task sync

2 participants