Skip to content

feat(messages): add message edit with WebSocket + ownership validatio…#205

Open
gelluisaac wants to merge 1 commit into
Lumina-eX:mainfrom
gelluisaac:feature
Open

feat(messages): add message edit with WebSocket + ownership validatio…#205
gelluisaac wants to merge 1 commit into
Lumina-eX:mainfrom
gelluisaac:feature

Conversation

@gelluisaac

@gelluisaac gelluisaac commented Jun 24, 2026

Copy link
Copy Markdown

Changes added:

  • Configurable edit window: lib/config.ts: MESSAGE_EDIT_WINDOW_MINUTES = 5
  • Database migration: scripts/017_message_edit.sql (edited_at column + RLS update policy)
  • Backend edit endpoint: app/api/messages/route.ts (PUT /api/messages with ownership validation and time-window enforcement)
  • WebSocket support: lib/websocket/server.ts + lib/websocket/client.ts + lib/websocket/hooks.ts + types/websocket.ts (message_edit events)
  • Frontend real-time handling: lib/websocket/chat-hooks.tsx (listens for message_edit and exposes handlers.editMessage)
  • UI label: components/MessageItem.tsx renders “Edited” when message.editedAt is present
  • Message type: src/types/message.ts adds optional editedAt
  • Unit tests: components/MessageItem.test.tsx and app/api/messages/tests/edit.test.ts

Acceptance criteria met:

  • Users cannot edit others’ messages
  • Edited messages display an Edited indicator
  • Real-time updates broadcast to all clients via WebSocket
  • Editing is restricted to the configured time window
  • No layout-breaking changes to message rendering
  • Unit tests included for backend validation and UI rendering
    closes Implement Message Edit Functionality #187

@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@gelluisaac Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SudiptaPaul-31

SudiptaPaul-31 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

@gelluisaac build fails

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.

Implement Message Edit Functionality

3 participants