Skip to content

Add socket.io realtime infrastructure backed by Redis#32

Merged
VectoDE merged 6 commits intomainfrom
codex/integrate-socket.io-and-redis-for-real-time-updates
Nov 3, 2025
Merged

Add socket.io realtime infrastructure backed by Redis#32
VectoDE merged 6 commits intomainfrom
codex/integrate-socket.io-and-redis-for-real-time-updates

Conversation

@VectoDE
Copy link
Copy Markdown
Owner

@VectoDE VectoDE commented Nov 3, 2025

Summary

  • add a Socket.IO API route and client provider so the UI refreshes when realtime events arrive
  • integrate Redis/BullMQ queues with a Prisma middleware to broadcast database mutations
  • expose helpers for publishing realtime events from server code

Testing

  • pnpm lint

https://chatgpt.com/codex/tasks/task_e_6908c14c86ac832ca53a61044f630ab9

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
portfolio Ready Ready Preview Comment Nov 3, 2025 5:08pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +30 to +37
try {
await enqueueRealtimeEvent(`prisma:${model}:${params.action}`, {
model,
action: params.action,
args: params.args,
result,
timestamp: Date.now(),
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid hanging Prisma writes when Redis is down

Each Prisma mutation awaits enqueueRealtimeEvent, and the Redis clients created in lib/redis.ts set maxRetriesPerRequest: null (infinite retries). When Redis is unavailable or misconfigured, queue.add never resolves nor rejects, so every database write waits forever before the middleware returns. This change effectively makes all writes dependent on Redis uptime even though the realtime queue is optional. Consider not awaiting the enqueue call or adding a bounded timeout/retry so mutations can complete even when Redis is offline.

Useful? React with 👍 / 👎.

@VectoDE VectoDE merged commit a488a9d into main Nov 3, 2025
5 of 6 checks passed
@VectoDE VectoDE deleted the codex/integrate-socket.io-and-redis-for-real-time-updates branch November 3, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant