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.

Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, currently working at Aircall. I'm open to work in various fields! zipking zipking I am a technologist and product builder dedicated to creating high-impact solutions at the intersection of AI and specialized markets. Currently, I am focused on PropScan (EstateGuard), an AI-driven SaaS platform tailored for the Japanese real estate industry, and exploring the potential of Archify. As an INFJ-T, I approach development with a "systems-thinking" mindset—balancing technical precision with a deep understanding of user needs. I particularly enjoy the challenge of architecting Vertical AI SaaS and optimizing Small Language Models (SLMs) to solve specific, real-world business problems. Whether I'm in a CTO-level leadership role or hands-on with the code, I thrive on building tools that turn complex data into actionable value. Nam Tran Nam Tran 10 years as fullstack developer Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions. Victor Denisov Victor Denisov Developer Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. 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.

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