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.

BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services PawelPloszaj PawelPloszaj I'm fronted developer with 10+ years of experience with big projects. I have small backend background too Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help 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. Matt Butler Matt Butler Software Engineer @ AWS Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking.

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