Codesandbox-client: Files Are Randomly Overwritten With Contents of Other Files When Saving

Created on 1 Aug 2018  ·  11Comments  ·  Source: codesandbox/codesandbox-client

🐛 bug report

Description of the problem

While working with CodeSandbox, when switching between files in the file editor, sometimes it happens that the content of the file being switched to are replaced with the contents of the file that was previously open.

It seems to happen randomly, but frequently. I've observed the bug with Chrome 67 and Firefox 62, both on MacOS 10.13.6.

It may have something to do with saving the files using the “Save” button in the top menu, possibly in conjunction with Prettier, which I use frequently, invoked by keyboard shortcut.

I've uploaded a video that shows me reproducing the issue:

https://youtu.be/51MpKqLBOJU

At 2:15, I hit the save button, at 2:18, the contents of App.js and Hello.js are suddenly identical.

How has this issue affected you? What are you trying to accomplish?

Since the code change cannot be undone, it makes it very hard and unnerving for me to work productively with CodeSandbox. I've resorted to downloading the code frequently to have a backup of my code when the bug happens.

Link to sandbox:

Here's a sandbox where the bug caused the code from one module to magically replace the code of two others, so that App.js, Hello.js and StartEditing.js all have the same contents:
https://codesandbox.io/s/7m52okr8yx

Your Environment

| Software | Name/Version|
| ---------------- | ---------- |
| Сodesandbox | PROD-1532796593-1ab3af9 |
| Browser | Chrome 67, Firefox 62 |
| Operating System | MacOS 10.13.6 |

Most helpful comment

This is the best issue description I've had in a while! Thank you, I will work on a fix today.

All 11 comments

Same issue for me. The most important feature is Save Files & its broken now. I used CodeSandBox sometime 12 hours ago but the new changes broke the Save Functionality. Can't do anything.

This is the best issue description I've had in a while! Thank you, I will work on a fix today.

Just pushed a fix for it. Will deploy in within the hour!

👍🏻Thank you, keep up the great work!

Well its not working yet

It works for me, I cannot reproduce the bug anymore (CodeSandbox PROD-1533293248-4a97495, MacOS 10.13.6, Firefox Dev Edition 62)

Naah I just tried again. It does not work for me in Safari Version 11.1.2 (13605.3.8). Mac OS 10.13.6.

I also logged out & logged in again just to be sure.

Okay so now it worked after I deleted the Local Storage & Session Storage.

Thank you @CompuIves 🙌

Issue isn't solved
what information can I provide?

Is this resolved? I am new to Codesandbox, but I had one file overwritten by another and I don't know why.

Was this page helpful?
0 / 5 - 0 ratings