Restore reactions, add constraint, handle errors

Restore soft-deleted message reactions and enforce uniqueness only for active reactions; add WebSocket error handling and minor UI/Docker tweaks.

- backend/social/chat/models.py: Toggle reaction now restores a stale soft-deleted MessageReaction (avoids unique conflicts) and creates new reactions as needed. Replaced unique_together with a conditional UniqueConstraint that applies only to non-deleted records.
- backend/social/chat/consumers.py: Wrap reaction toggle in try/except to return a WS error message on failure instead of allowing exceptions to bubble up.
- frontend/src/components/social/chat/Message.tsx: Adjusted Tailwind max-width class for the reaction menu (max-w-32).
- docker-compose.yml: Added commented example configuration for an optional Janus media server (documentational/commented service).

These changes prevent unique constraint errors when restoring reactions, improve robustness of the WebSocket reaction flow, and include small UI and deployment notes.
This commit is contained in:
David Bruno Vontor
2026-06-04 16:45:16 +02:00
parent 3859659b13
commit b1f88ca501
4 changed files with 45 additions and 17 deletions

View File

@@ -87,6 +87,21 @@ services:
networks:
- app_network
# janus-media-server: #WebRTC media server for handling real-time audio/video streaming
# container_name: janus-vontor-cz
# image: meetecho/janus-gateway:latest
# restart: always
# env_file:
# - ./backend/.env
# ports:
# - "8088:8088" # HTTP API
# - "8188:8188" # WebSocket API
# - "10000-10200:10000-10200/udp" # Media ports (UDP)
# networks:
# - app_network
#https://github.com/meetecho/janus-gateway
#end of backend services -----------------------
nginx: #web server, reverse proxy, serves static files