Code Editor corrupting changes

Today I am having an issue with the code editor corrupting edited files. Changes I type will look ok in the editor but after saving and reopening the file changes end up in random places and overwrite other code.

I’ve seen this problem once before but could not reproduce outside of one file or in a new project.

Would it be possible to fork project and give me ownership/edit access to look at (assuming the issue is also present in a fork)? (Username ‘yaustar’)

In your current project, is it only happening in this one file? If so, I would try creating a new code file and copying the contents over and deleting the old corrupted file.

(Side note, most of the team is off on holidays so we won’t be able to look at this till the new year)

1 Like

Forking didn’t reproduce the issue. I’ve just noticed it in the one file but that is the only file I’ve edited today. I’ve been afraid to edit other files.

Edit: Here are more details…

I edited the file and saved it as it should be below

Then reopening the file, the changes I made show up in other places corrupting the file as below.

Notice the filename is orange indicating unsaved changes. This is how it loads in. the editor thinks there are changes even though no changes have been made in this session.

I’ve tried reloading the browser same thing. Opening the corrupted file, the editor indicates unsaved changes after first opening and further corrupts the file if changes are made and saved.

I was able to make a copy of the file and the copy does not have any issues. Renaming the corrupted file and doesn’t fix it. The copy can be renamed to the original name and is now working properly. I’ve kept the corrupted file in the project in case it is helpful to you for debugging.

1 Like

Yes, it looks like the issue I ran into before :frowning: where changes are one character off or something.

Annoying that it doesn’t happen in a fork. I wonder if it happens on a branch? If it does, that would be ideal as we can hop in, take a look in the branch without affecting your main project.

I made a new checkpoint and branched from that. No issue. The previously corrupted file works on the branch.

I also tried a branch from my checkpoint from yesterday. Also no issues with the branch.

Returning to the branch I was working on, the corrupted file is still misbehaving. It does seem to be just that one file though.

Thanks for looking into it further.

Would it be possible to have the asset id of the misbehaving script please? You van either post it here or send by DM.

Maybe we can find out what’s happening via that

We can’t gleam anything from the logs unfortunately :frowning: It’s one of those that unless we can reproduce it, it’s going to be super tough to track down.

I think to get around this would involve doing a branch and merging the branch back to master immediately and that might fix the issue.

I now have a reproducible project for this so flagging this internally

We’ve investigated this and it was due to an file encoding issue where there was an invisible character at the beginning of the file that was not being handled correctly.


Best workaround is to create a new file and copy the contents in it or download the file, change the encoding and reupload again