Skip to content

When copy all contents of a file to another, the two files become linked #1887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JetStarBlues opened this issue Jun 16, 2021 · 1 comment · Fixed by #1902
Closed

When copy all contents of a file to another, the two files become linked #1887

JetStarBlues opened this issue Jun 16, 2021 · 1 comment · Fixed by #1902
Labels
Priority:High Should be addressed soon but not critical

Comments

@JetStarBlues
Copy link

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: Chrome 91.0.4472.77 (64-bit)
    • I was not able to reproduce this behaviour on Firefox 89.0 (64-bit)
  • Operating System: Windows 10

Steps to reproduce this bug:

  • Step 1
    • create a new file (thecopy.js)
  • Step 2
    • copy all of the contents of sketch.js to this new file using:
      • ctrl-a, ctrl-c, ctrl-v
  • Step 3
    • edit the original file (sketch.js)
    • The bug:
      • changes made in the original file are reflected in the new file (thecopy.js)
        • the files have become linked somehow
      • a simple refresh doesn't seem to clear this link
        • sort of (this is tricky to track down, sometimes a couple of refreshes does clear)
        • a "hard reload" seems to clear the link

Maybe somewhere along the line, instead of a true copy (deep), the file contents are just copied by reference (shallow).

I've encountered this bug a couple of times, when attempting to "save" existing work and create a new copy where I'm free to delete/change etc. Or when wanting to use one file as a template.

@JetStarBlues JetStarBlues changed the title When copy contents of a file to a new file, the two files become linked When copy contents of a file to another, the two files become linked Jun 16, 2021
@JetStarBlues JetStarBlues changed the title When copy contents of a file to another, the two files become linked When copy all contents of a file to another, the two files become linked Jun 16, 2021
@catarak catarak added Priority:High Should be addressed soon but not critical type:bug labels Jul 16, 2021
@catarak
Copy link
Member

catarak commented Jul 16, 2021

Thanks for reporting! I am able to reproduce. I'm going to do some investigating and see if I can figure out the root cause.

catarak added a commit that referenced this issue Jul 19, 2021
[#1887][#1890] Swap Codemirror doc when file id changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:High Should be addressed soon but not critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants