Skip to content

Improve WebSocket Server backend + Chat Improvements - #99

Merged
chrisgoggins merged 5 commits into
mainfrom
brianna/websocket
Sep 15, 2026
Merged

chrisgoggins merged 5 commits into
mainfrom
brianna/websocket

Conversation

@bzhang625

@bzhang625 bzhang625 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Resolves #93 + #97. Splits the single index.mjs into different modules, redacts chat contents from production logs behind NODE_ENV, and sanitizes client-facing socket errors while logging full details server-side. Replaces the in-memory chat map with a MongoDB-backed chat record per ride.

Checklist

  • Title is the same as the ticket title
  • Ticket is mentioned above
  • Changes fulfill the ticket's acceptance criteria
  • Relevant developers have been assigned
  • Relevant reviewers (EM, Designers, etc.) have been requested

@netlify

netlify Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for able-alliance ready!

Name Link
🔨 Latest commit 31c4fd7
🔍 Latest deploy log https://app.netlify.com/projects/able-alliance/deploys/6aa9c37449861f0008d9a1a4
😎 Deploy Preview https://deploy-preview-99--able-alliance.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bzhang625 bzhang625 self-assigned this Sep 11, 2026
@chrisgoggins chrisgoggins linked an issue Sep 15, 2026 that may be closed by this pull request
9 tasks

@chrisgoggins chrisgoggins left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good work! A few changes regarding to DB model lifecycle:

  • Create the active chat record in Next.js (instead of the WebSocket server) when a driver is assigned and the ride transitions from Requested to Scheduled
  • Archive the chat in the Next.js route actions when the ride transitions to Completed, Missing, or a cancellation status (relates to next bullet point)
  • Rename the WebSocket event from endRoute to closeRouteRoom. Also it should only broadcast routeClosed and disconnect the room, with no database writes

This moves important database actions outside of the WebSocket server which is preserved since WebSockets are more error prone

@chrisgoggins
chrisgoggins merged commit 7110ec5 into main Sep 15, 2026
5 checks passed
@chrisgoggins
chrisgoggins deleted the brianna/websocket branch September 15, 2026 22:34
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.

Chat Improvements Improve WebSocket Server

2 participants