Bolt realtime

Collaborative Editing Feature Broken in Bolt App

Your Bolt.new application has a collaborative editing feature (shared documents, kanban boards, whiteboards) where multiple users should be able to edit simultaneously, but changes from one user overwrite another's work, edits don't appear in real-time, or the document gets into a corrupted state with missing or duplicated content.

Collaborative editing is one of the hardest technical challenges in web development. It requires real-time synchronization, conflict resolution, presence awareness, and careful state management. When Bolt generates collaborative features, it often implements basic database saving without the synchronization layer that makes true collaboration work.

Users experience this as: changes disappearing after they save, seeing stale content that doesn't match what others are editing, or two users making simultaneous changes where only the last save survives and the other's work is lost.

Error Messages You Might See

Error: Document version conflict - please refresh Broadcast message failed: channel not subscribed TypeError: Cannot apply operation to undefined document Conflict detected: document was modified by another user WebSocket disconnected: retrying in 5 seconds
Error: Document version conflict - please refreshBroadcast message failed: channel not subscribedTypeError: Cannot apply operation to undefined documentConflict detected: document was modified by another userWebSocket disconnected: retrying in 5 seconds

Common Causes

  • Last-write-wins without conflict resolution — Each save overwrites the entire document, so the last person to save destroys everyone else's concurrent changes
  • No real-time sync between clients — Changes are saved to the database but other connected users don't receive updates until they refresh
  • Missing optimistic concurrency control — No version tracking or timestamps to detect when two users edit the same data simultaneously
  • Presence information not shared — Users can't see who else is editing, leading to unknowing concurrent edits on the same section
  • Database updates too coarse — The entire document is replaced on each edit instead of applying granular operations (insert text at position X)

How to Fix It

  1. Use Supabase Realtime for sync — Broadcast changes through Supabase channels: const channel = supabase.channel('doc:' + docId); channel.on('broadcast', { event: 'edit' }, handleRemoteEdit).subscribe()
  2. Implement operational transforms or CRDTs — For text editing, use a library like Yjs or Automerge that handles conflict resolution: const ydoc = new Y.Doc(); const provider = new SupabaseProvider(supabase, ydoc, docId)
  3. Add presence awareness — Show who is editing with cursor positions: channel.track({ user: currentUser, cursor: cursorPosition })
  4. Use granular updates — Instead of replacing the whole document, send operations: { type: 'insert', position: 42, text: 'hello' } and apply them to each client's local state
  5. Add version numbers — Track document versions and reject stale updates: UPDATE docs SET content = $1, version = version + 1 WHERE id = $2 AND version = $3
  6. Implement undo/redo — Maintain an operation history so users can undo both their own and others' changes if needed

Real developers can help you.

Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever Matt Butler Matt Butler Software Engineer @ AWS Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale. AUXLE AUXLE I am a Full Stack Developer experienced in building Websites, Web apps and Cross Platform Mobile Apps for Startups and Companies. Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Nam Tran Nam Tran 10 years as fullstack developer legrab legrab I'll fill this later Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/ Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Mehdi Ben Haddou Mehdi Ben Haddou - Founder of Chessigma (1M+ users) & many small projects - ex Founding Engineer @Uplane (YC F25) - ex Software Engineer @Amazon and @Booking.com

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What is the easiest way to add collaborative editing to a Bolt app?

Use Yjs with Supabase as the sync provider. Yjs handles conflict resolution automatically using CRDTs (Conflict-free Replicated Data Types). Install yjs and create a shared document that syncs through Supabase Realtime channels.

Why does the last person to save overwrite everyone else's changes?

This is the 'last-write-wins' problem. When you save the entire document, you overwrite whatever was there, including other users' unsaved changes. The fix is to send granular operations (insert, delete, update at specific positions) instead of replacing the whole document.

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help