Files
orangecat/docs/archive/development/messaging-system.md
CatoandClaude 45fd5e076a docs: archive 2025 plans that read as current (#1351)
Forty-five 2025 plans, assessments, design scenarios, status reports and
superseded business docs move to docs/archive/ (same relative path). Each
described a plan or a snapshot as if it were the running system: strict:false,
a five-table schema, an "organization" entity, price_sats, a Gemini /api/chat
widget, a /auth/forgot-password page, Google Places, building group labels and
contract voting flows that never landed.

Fixed in place: NAVIGATION_UX_DESIGN.md (referenced by .claude/rules) gains a
status note naming what shipped and where; GENERIC_API_HANDLERS.md lists the
handler options the code actually takes; datetime_standards.md points at
scripts/dev/; CONTRIBUTING.md describes the auto-merge shipping flow. Inbound
links repointed (SECURITY.md at the root, SUPABASE_SCHEMA_GUIDE.md for schema).


Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:25:12 +02:00

2.4 KiB
Raw Permalink Blame History

Messaging System Notes

created_date: 2025-12-08
last_modified_date: 2025-12-11
last_modified_summary: Link avatars/names in DM list and header to profiles

  • Conversations now load via get_user_conversations RPC to avoid duplicate rows from older views.
  • Detail view fallback uses conversation_details with a safe maybeSingle to prevent "Conversation not found" when multiple rows existed.
  • New migration 20251208_grant_messaging_permissions.sql grants authenticated users access to messaging views/functions.
  • Removed console logging in the new conversation modal to keep production logs clean.
  • Validate after deploy: open /messages, start a new conversation, and send/receive replies between two users.
  • Next.js 16 (like 15 before it) requires awaiting route params; messages/[conversationId] handlers now await params to avoid runtime errors.
  • Dev-only auto-migration call to /api/admin/apply-messaging-migrations now records failed attempts to prevent repeated 500s when SUPABASE_ACCESS_TOKEN is missing; run the migrations manually when credentials are unavailable.
  • Auth state changes post to /api/auth/callback and also prime the current session on mount so Supabase cookies stay in sync and /api/messages handlers don’t return 401 on first load.
  • Conversation fetch now trusts get_user_conversations scoping for auth, and if that fails, falls back to any participant row (even inactive) plus a minimal conversation fetch to avoid false 403s that were triggering the new-conversation modal.
  • /api/profiles now returns a standard paginated array shape (with metadata for page/limit/total) so the new-conversation picker renders user rows and search results correctly.
  • Messages UI now mirrors the split-view DM layout (tabs, refined search, softer empty state with primary CTA) to make starting or finding chats easier.
  • Conversation list rows are tightened to the X/Twitter DM look; long-press to enter selection mode on touch, drag across rows (mouse or touch) to select/deselect quickly, and unread chips surface request-like items when the Requests tab is active.
  • Message bubbles now show WhatsApp-style delivery/read ticks: single gray = sent, double gray = delivered to someone, double colored = read by all recipients; pending/failed still show inline.
  • Bulk delete flows now confirm when removing multiple items and surface success/error toasts for conversations and in-thread message deletes.