3 Real Time Sync
Maurice edited this page 2026-03-30 22:43:03 +02:00

Real-Time Sync

TREK uses WebSockets for instant synchronization between all connected users.

How it Works

  1. When you open a trip, your browser connects via WebSocket to /ws
  2. You join a "room" for that trip
  3. Any change (add/edit/delete place, reorder, etc.) is broadcast to all other users in the room
  4. Changes appear instantly without page reload

What Syncs in Real-Time

  • Places (create, update, delete)
  • Day assignments (add, remove, reorder, move between days)
  • Day notes
  • Accommodations
  • Packing list items and categories
  • Budget items
  • Reservations / Bookings
  • Trip settings and members
  • Collab notes, polls, messages, and reactions
  • Vacay entries and plan changes

Requirements

  • WebSocket connection must not be blocked by your reverse proxy (see Reverse Proxy)
  • Modern browser (all current browsers support WebSockets)

Troubleshooting

"WebSocket connection failed" in console:

  • Check your reverse proxy configuration — the /ws path needs WebSocket upgrade headers
  • See Reverse Proxy for the correct Nginx config

Changes not appearing for other users:

  • Both users must be viewing the same trip
  • Check browser console for WebSocket errors
  • Verify the WebSocket connection with: open DevTools → Network → WS tab — you should see a ws connection