From dba33b57339bdb058fa265c0c2beebc36e404946 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Sat, 16 May 2026 08:50:04 +0200 Subject: [PATCH] feat(db): enable realtime publication for direct_messages + chat_messages Same pattern as notifications/protected_devices/user_custom_domains: without ALTER PUBLICATION supabase_realtime ADD TABLE, Postgres does not broadcast inserts and clients receive no live messages. Co-Authored-By: Claude Opus 4.7 --- .../20260516_enable_chat_realtime/migration.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 backend/prisma/migrations/20260516_enable_chat_realtime/migration.sql diff --git a/backend/prisma/migrations/20260516_enable_chat_realtime/migration.sql b/backend/prisma/migrations/20260516_enable_chat_realtime/migration.sql new file mode 100644 index 0000000..26abc89 --- /dev/null +++ b/backend/prisma/migrations/20260516_enable_chat_realtime/migration.sql @@ -0,0 +1,8 @@ +-- Enable Supabase Realtime for direct_messages and chat_messages tables. +-- Fixes missing live delivery on the DM-Page: +-- rebreak.direct_messages and rebreak.chat_messages were not part of the +-- supabase_realtime publication, causing postgres_changes subscriptions +-- (INSERT events) to be silently dropped — messages only appeared after +-- manual refresh. +ALTER PUBLICATION supabase_realtime ADD TABLE rebreak.direct_messages; +ALTER PUBLICATION supabase_realtime ADD TABLE rebreak.chat_messages;