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.

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 Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. 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. BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. 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. Antriksh Narang Antriksh Narang 5 years+ Experienced Dev (Specially in Web Development), can help in python, javascript, react, next.js and full stack web dev technologies. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Franck Plazanet Franck Plazanet I am a Strategic Engineering Leader with over 8 years of experience building high-availability enterprise systems and scaling high-performing technical teams. My focus is on bridging the gap between complex technology and business growth. Core Expertise: 🚀 Leadership: Managing and coaching teams of 15+ engineers, fostering a culture of accountability and continuous improvement. 🏗️ Architecture: Enterprise Core Systems, Multi-system Integration (ERP/API/ETL), and Core Database Structure. ☁️ Cloud & Scale: AWS Expert; architected systems handling 10B+ monthly requests and managing 100k+ SKUs. 📈 Business Impact: Aligning tech strategy with P&L goals to drive $70k+ in monthly recurring revenue. I thrive on "out-of-the-box" thinking to solve complex technical bottlenecks and am always looking for ways to use automation to improve business productivity. Meïr Ankri Meïr Ankri Full-stack developer specializing in React / Next.js / Node.js with 6+ years of experience. I've worked across various sectors including automotive (Reezocar/Société Générale), healthcare (Medical Link SaaS), and e-commerce (Glasman). I build web apps end-to-end, from architecture to production, with a focus on scalability, performance, and code quality. I also mentor junior developers and contribute to technical decisions and code reviews. Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure

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