jgraph/drawio-desktop · warning · Error
conflict
Error message
conflict
What it means
saveFile's non-overwrite path (src/main/electron.js:3553-3561) stats the target file and compares its mtimeMs to origStat (via isConflict, line 3168-3171). If they differ, another process edited the file since drawio last read it, so saving would clobber someone else's work — it throws 'conflict' instead.
Source
Thrown at src/main/electron.js:3560
}
}
}
return await writeFile();
};
if (overwrite)
{
return await doSaveFile(true);
}
else
{
let stat = fs.existsSync(fileObject.path)?
await fsProm.stat(fileObject.path) : null;
if (stat && isConflict(origStat, stat))
{
throw new Error('conflict');
}
else
{
return await doSaveFile(stat == null);
}
}
};
async function writeFile(filePath, data, enc)
{
if (!checkFileContent(data, enc))
{
throw new Error('Invalid file data');
}
await assertWritablePath(filePath);
let fh;View on GitHub (pinned to 403a2cb79f)
Solutions
- Prompt the user and re-save with overwrite=true (args.overwrite) after they confirm.
- Re-read the file and merge or pick a winner before saving.
- Avoid editing shared/cloud-synced diagrams with two writers; close other editors first.
Example fix
// before
saveFile(fileObject, data, origStat, false);
// after
try { await saveFile(fileObject, data, origStat, false); }
catch (e) {
if (e.message === 'conflict' && await confirmOverwrite()) {
await saveFile(fileObject, data, await fs.stat(fileObject.path), true);
} else throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
async function fileUnchangedSince(origStat, p) {
if (!origStat || !fs.existsSync(p)) return true;
const s = await fsProm.stat(p);
return s.mtimeMs === origStat.mtimeMs;
} Try / catch
try { await saveFile(fileObject, data, origStat, false); }
catch (e) {
if (e.message === 'conflict' && await userConfirmsOverwrite()) {
const fresh = await fsProm.stat(fileObject.path);
await saveFile(fileObject, data, fresh, true);
} else throw e;
} Prevention
- For shared/cloud-synced files, prefer overwrite=true after explicit user confirmation.
- Refresh origStat after every save so subsequent saves compare against the latest mtime.
- Warn users when two editors have the same file open.
When it happens
Trigger: User A opens a shared file, user B saves it, then user A triggers save without overwrite=true; a cloud-sync client rewrote the file (touching mtime) between open and save; an external editor auto-formatted it.
Common situations: Network shares, Dropbox/OneDrive/Google Drive folders, git checkouts touched by another tool, or two drawio windows editing the same file.
Related errors
AI-assisted analysis of jgraph/drawio-desktop@403a2cb79f (2026-08-13).
Data as JSON: /api/errors/4d9fcbf87ca96a59.
Report an issue: GitHub.