[Editor] Lost file content

I selected an open tab of a text file called TODO.
I tried to edit the content, but suddenly all the content disappeared, with an error at the bottom.
I thought it was a connection problem so I refreshed (unfortunately I didn’t take the error details), but the content was gone and I can’t take it back.
The asset id is 11165351.
It happened around 9:30 UTC, in case you have an error log to check.

Can you try reverting the file? Right click on the file in the left tab in the Code Editor and click Revert.

I didn’t know there was that option, so I didn’t try. It was a short list of TODO so I rewrote it and saved over.
Anyway now the Revert option is disabled, even after a change. When it is supposed to be available?

The Revert option is available when the contents of the document do not match the ones that are currently saved for that Asset. So if you open a document and its contents are different the Asset will show the Revert option. But you have to open it first to see it.

It happened again, and again, like an idiot, I refreshed without copying the error message.
This time I lost a piece of code and the revert button didn’t help.
It happened after I came back the next day on the web page that was still opened, and I tried to edit the code. After few edits, it suddenly changed to an older version, in some placed also with scrambled letters.
I hope you can find a way to find/resolve the issue. It’s a “bit” uncomfortable to have to rewrite the code.
I’d like to store the files locally and use Git, but I can’t afford 50$/month just to get this feature and go around a bug.

About the mixing of letters, I found that it placed the last edits in different places on the older version of the file.

Hi @mcmorry, I’m so sorry this happened to you again. It’s helpful that you say this happened after you started writing code the next day on the open tab. We’re going to look into this.

1 Like

I don’t know if this is related to the loss of file content, but this morning I arrived and there was an error in the code editor, suggesting to refresh. Maybe is due to the last maintenance you had a few hours ago.

Anyway, here is the log (GMT +1):

16:31:59.587 messenger.js:80 messenger connected

16:31:59.720 VM121:25 Uncaught TypeError: Cannot read property ‘appendChild’ of null
at Object. (:25:41745)
at n (:25:101)
at Object. (:49:133870)
at n (:25:101)
at :25:452
at _inject (:25:463)
at :57:3

01:14:13.344 messenger.js:42 messenger reconnecting

01:14:15.248 messenger.js:31 WebSocket connection to ‘wss://msg.playcanvas.com/messages’ failed: Error during WebSocket handshake: Unexpected response code: 502
Messenger.connect @ messenger.js:31

01:14:15.248 messenger.js:99 Eventbubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: WebSocket {url: “wss://msg.playcanvas.com/messages”, readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}defaultPrevented: falseeventPhase: 0isTrusted: truepath: []returnValue: truesrcElement: WebSocket {url: “wss://msg.playcanvas.com/messages”, readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}target: WebSocket {url: “wss://msg.playcanvas.com/messages”, readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}timeStamp: 31338178.199999966type: "error"proto: Event
Messenger._onerror @ messenger.js:99

08:16:54.886 code-editor-v2.js:40409 Error: Invalid protocol version
at exports.Connection.Connection.handleMessage (code-editor-v2.js:172)
at socket.onmessage (code-editor-v2.js:126)
at WebSocket.connection.socket.onmessage (code-editor-v2.js:40544)
at createShareJsConnection (code-editor-v2.js:40561)
at WebSocket.onMessage (code-editor-v2.js:40480)
(anonymous) @ code-editor-v2.js:40409

Yeah we upgraded various libraries so that seems like an expected error.