Skip to content

Duplicate edges pasted at random places #2382

Closed

Description

@Tomas-Bueno-Momcilovic

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

Describe the bug

Duplicate edges (i.e., arrows) get created in seemingly random places in the diagram. As far as I can notice, these are duplicates of edges I copy-pasted to use elsewhere, which get re-pasted somewhere else with a delay. This only applies to edges. I am confident I haven't accidentally pasted two times.

To Reproduce
Steps to reproduce the behavior:

  1. Create an edge between two nodes.
  2. Copy-paste the edge elsewhere (e.g., to attach to additional two nodes).
  3. Repeat until the duplicates occur.

Or:

  1. Create an example diagram with nodes and edges.
  2. Save it and close the app.
  3. Open the diagram in the app again.
  4. Repeat until duplicates are scattered across the canvas.

Expected behavior
Only single copy-pasted edge, and not additional duplicate edges.

Screenshots
Image

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 29.6.6

Desktop (please complete the following information):

  • OS: Windows

Additional context
Nothing I can think of. Would be happy to provide additional things if needed.

Activity

  1. draw-io-triage-bot commented on Apr 10, 2026

    @draw-io-triage-bot

    👋 Thank you for opening this issue!


    Summary: The user reports that when copy-pasting edges (arrows) between nodes in draw.io desktop v29.6.6 on Windows, duplicate edges appear at seemingly random locations on the canvas, either shortly after pasting or after saving and reopening the diagram.


    📝 Additional Information Needed

    To help us investigate this more effectively, could you please provide:

    • Sample diagram file: A .drawio file that exhibits the issue (or one where the issue can be reliably reproduced) would greatly help developers debug this. The screenshot is helpful but an actual file would allow inspection of the XML for anomalies.
    • Storage backend: Is the file saved locally, on Google Drive, OneDrive, or another cloud storage? This could matter if the issue involves save/reload cycles.
    • Reproducibility details: The two reproduction paths suggest the issue is intermittent. How frequently does this occur — every time, or only occasionally? Does it happen immediately after paste, or only after saving and reopening?
    • Clipboard method: Are you using Ctrl+C / Ctrl+V, right-click context menu, or the Edit menu to copy-paste? This can matter for edge-specific clipboard handling.

    We also have some questions:

    • Can you share the .drawio XML file (or a minimal version of it) where duplicate edges appear? This would let developers inspect whether the duplicates exist in the saved XML or are rendered at open time.
    • When you say the duplicates appear 'with a delay' — do you mean they appear seconds after pasting, or do they appear only after saving and reopening the file?
    • Are the duplicate edges connected to any nodes, or are they floating/unattached? In the screenshot, can you identify which edges are the originals and which are the duplicates?
    • Does this happen with a brand new, simple diagram (e.g., just 2 nodes and 1 edge, copy-paste once), or only in larger/more complex diagrams?
    • Where is the file stored — locally on disk, or via a cloud integration (Google Drive, OneDrive, etc.)?
    📋 Bug Report Template
    **Environment:**
    - draw.io version: [e.g., web app / desktop 24.x.x / Confluence plugin]
    - Browser (if web): [e.g., Chrome 120, Firefox 121]
    - OS: [e.g., Windows 11, macOS 14, Ubuntu 22.04]
    
    **Steps to Reproduce:**
    1. Go to ...
    2. Click on ...
    3. See error
    
    **Expected Behavior:**
    What you expected to happen.
    
    **Actual Behavior:**
    What actually happened.
    
    **Screenshots/Files:**
    If applicable, add screenshots or attach the .drawio file.
    
    ---

    🤖 This is an automated response to help with initial triage. A human maintainer will review this issue. If you've provided all the requested information, no further action is needed - we'll get back to you soon!

  2. Tomas-Bueno-Momcilovic commented on Apr 10, 2026

    @Tomas-Bueno-Momcilovic
    Author
    • Sample diagram file: I don't keep these extra edges in my working diagrams. Unfortunately, I'm unable to reliably reproduce the issue in a separate file. It is very likely a OneDrive merging conflict issue, which is known to happen in other apps (e.g., SumatraPDF, see linked issue).
    • Storage backend: OneDrive with local sync enabled.
    • Reproducibility details: Not very frequently, but often enough to be noticeable (every ~10 copy-paste). It's not a blocking issue, but annoying nonetheless.
    • Clipboard method: Almost exclusively Ctrl+C --> Ctrl+V.

    Questions:

    • No, sorry. When I manage to reproduce the issue, I will extract and share.
    • Both. Please see description above.
    • Floating/unattached only.
    • Unclear, but currently larger/more complex diagrams.
    • Answered above.

    Note to human maintainers: Consider adding to the system prompt of your Triage Bot to not repeat questions or addressed points.

  3. Tomas-Bueno-Momcilovic commented on Apr 17, 2026

    @Tomas-Bueno-Momcilovic
    Author

    Another example, after opening the diagram:

    Image
  4. alderg commented on May 7, 2026

    @alderg
    Contributor

    Thanks for reporting this. We've been looking into possible causes and have a few leads, but to narrow it down we need some additional information:

    1. Can you share a .drawio file that already has the duplicate edges? Even a minimal example would help — we want to inspect the raw XML for clues (e.g. duplicate cell IDs).

    2. Are the duplicate edges exact copies of existing edges (same style, label, terminals), or are they disconnected edges that appear at seemingly random coordinates?

    3. Does this happen with a fresh diagram, or only with files that have been edited/saved many times?

    4. Are you using any plugins or custom configuration (Extras → Configuration)?

    5. Does it also reproduce on app.diagrams.net, or only in the desktop app?

    If you can reproduce it reliably, enabling the debug console (Help → Toggle Developer Tools) before triggering the issue and checking for any Duplicate ID warnings in the console output would also be very helpful.

  5. Tomas-Bueno-Momcilovic commented on Jun 28, 2026

    @Tomas-Bueno-Momcilovic
    Author
    1. I've been unable to reproduce it in the days since. Not sure why.
    2. Exact copies (style, label, direction) but at random coordinates.
    3. Only with files that have been edited/saved many times.
    4. No.
    5. Only in the desktop app. I haven't tried it in the web app.

    I can reopen the issue if it comes up again.

  6. alderg commented on Jul 28, 2026

    @alderg
    Contributor

    We've reproduced this deterministically and identified the mechanism. It needs a file sync client (OneDrive here) rewriting the file on disk around your edits:

    1. You paste an edge (a paste always mints a fresh cell id) and the file is saved.
    2. The sync client briefly replaces the file on disk with an older version (a rollback, e.g. while resolving a sync conflict). draw.io shows "The file has been modified. Click here to synchronize." — synchronizing faithfully adopts the older state, so your pasted edge silently disappears.
    3. You paste it again (which mints another new id) but haven't saved yet.
    4. The sync client writes the delayed echo of the earlier save back to disk. Synchronizing merges that state in: it re-inserts the old copy of the edge (different id, so no conflict is detected anywhere), while your unsaved re-paste is kept. Result: two identical edges — unattached and offset from the original, which is why they appear at seemingly random places. The next save persists both, which is why they survive closing and reopening.

    The "delay" you observed matches the file watcher's ~5s polling plus the sync client's latency, and since this duplicates whatever was re-created between the rollback and the echo, copying edges specifically explains why only edges were affected.

    Fix: the desktop app now detects when the file on disk was replaced by an older version of itself (a rollback or an echo of a previous save in the current session) and asks explicitly — Overwrite (keep your current version and write it back to disk) or Synchronize (load the older version) — instead of merging silently. This will ship with an upcoming desktop release.

    Until then, pausing OneDrive sync while editing (or keeping actively edited diagrams outside a synced folder) avoids the trigger. Thanks for the detailed report — the observation that only copy-pasted edges were affected was the key clue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions