# Several people changing one module

What happens when more than one Workspace Admin builds or changes the same module, and how to sort out a clash.

Several Workspace Admins can build modules in the same workspace. The platform never merges two people's changes behind your back: a change made on old code is refused, with a message saying why, so nobody's work is lost without warning.

## Who can build

Every **Workspace Admin** can use the Module Builder, check modules out and in, publish, deploy and list modules. There's no builder role for other people yet.

## One shared draft

- **Everyone works in the same draft of a module.** The Module Builder and check-ins from people's computers all add revisions to it, and everyone sees the same preview.
- **See who's on it.** The builder's header shows **Checked out by** and the person's name when someone has the code on their computer; point at it to see who started the draft. The builder tells you before it changes a module someone has checked out.
- **Your chats are your own.** Each person has their own conversations with the builder.

## When someone checked in before you

You checked a module out, and while you worked someone else checked in (or the builder changed the draft). Your check-in is refused:

> **The module has moved on since your check-out:** you started from live version 0.1.0, it is now at draft revision 1. Get the latest, merge your changes into it, and check in again.

1. **Commit your own changes** in your folder first.
2. **Get the latest**: `dv modules pull`. It brings in the other person's changes and merges them with yours.
3. **Sort out any conflict.** Where you both changed the same lines, Git marks them in the file. Keep what should stay, remove the markers, and commit.
4. **Check in again**: `dv modules checkin -m "what you changed"`.

Working with your AI assistant? It is told the same thing, checks out again and redoes its change on top.

## When a draft is behind live

A draft starts from the version that's live. If a newer version goes live while the draft is open (someone published another draft, or deployed from their AI assistant or the command line), the draft is now on old code. Publishing it would undo their changes, so the Module Builder stops it:

> **This draft is on old code.** It started from version X, and version Y has gone live since.

1. Click **Start again from live**. The draft restarts from the version that's live now; its earlier changes are not carried over.
2. Ask the builder for your change again.

Or click **Discard the draft** if you no longer need it. Check-ins are refused too while such a draft is open.

## Publish several modules together

When modules depend on each other, **Publish together** checks every one first. If any fails, nothing is published. They then go live in order, each before the modules that use it.

## Agree a few habits

- **Check `dv modules checkouts`** (or the builder header) before starting on a module, and tell the other person.
- **Check in small changes often.** The longer a check-out stays out, the more you'll have to merge.
- **Refresh clone** rebuilds the development copy for everyone: other people's previews are removed (their drafts are kept).
- **Publish together** includes every previewed draft, including other people's. Untick the ones that aren't yours.


Source: https://datavisions.ai/docs/creators/several-people-changing-one-module
