Files
orangecat/scripts/check-realtime.sh
T
Your NameandClaude Opus 4.5 bcfb0aa8de security: remove all hardcoded secrets from scripts and docs
- Replaced 29 JWT tokens with environment variable references
- Deleted docs/operations/SUPABASE_API_GUIDE.md (contained real keys)
- Removed mcp-servers/node_modules from git tracking (716 files)
- Updated .gitignore to prevent future exposure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 13:11:53 +01:00

36 lines
1.4 KiB
Bash

#!/bin/bash
SERVICE_KEY="${SUPABASE_SERVICE_ROLE_KEY}"
BASE_URL="https://ohkueislstxomdjavyhs.supabase.co"
# Check realtime config via the Supabase REST API
echo "Checking realtime enablement for tables..."
# This checks if the messages table has replica identity configured for realtime
echo "1. Checking messages table replica identity..."
curl -s "${BASE_URL}/rest/v1/" \
-H "apikey: ${SERVICE_KEY}" \
-H "Authorization: Bearer ${SERVICE_KEY}" 2>/dev/null | head -5
# We can verify realtime works by checking the /realtime/v1/websocket endpoint
echo ""
echo "2. Realtime endpoint check..."
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" "${BASE_URL}/realtime/v1/websocket?apikey=${SERVICE_KEY}&log_level=error"
echo ""
echo "3. Testing mark_conversation_read function..."
curl -s "${BASE_URL}/rest/v1/rpc/mark_conversation_read" \
-H "apikey: ${SERVICE_KEY}" \
-H "Authorization: Bearer ${SERVICE_KEY}" \
-H "Content-Type: application/json" \
-d '{
"p_conversation_id": "2ef0fe8f-79ba-497e-8fe2-b66a9e4759a3",
"p_user_id": "cec88bc9-557f-452b-92f1-e093092fecd6"
}' | jq .
echo ""
echo "4. Verifying read time was updated..."
curl -s "${BASE_URL}/rest/v1/conversation_participants?conversation_id=eq.2ef0fe8f-79ba-497e-8fe2-b66a9e4759a3&user_id=eq.cec88bc9-557f-452b-92f1-e093092fecd6&select=last_read_at" \
-H "apikey: ${SERVICE_KEY}" \
-H "Authorization: Bearer ${SERVICE_KEY}" | jq .[0].last_read_at