WebIDE Save Issue

Posted on
  • Using the WebIDE it is corrupting data when saving.

    Basically it is adding extra lines or moving text about and putting it in the wrong place, normally only a bit of text.

    I have had it duplicate entire functions as well.

    e.g. I have just done a save and it has saved it as this:

    setTimeout(startWiFi, 3000);
    setTimeout(startWiFi, 3000);
    tWiFi, 3000);

    There was only one setTimeout(startWiFi, 3000); when I saved it.

    I have only edited the files through the WebIDE and it has happened on multiple files.

    I only installed the WebIDE in the last couple of days so it should all be the latest versions.

    Has anybody else experienced this?

  • Yes, I see it regularly, it is specially when I delete something and save it.
    When I open it again, there are errors in the file.
    I have to open the file in an editor and remove the junk.

  • Same here. I resort to copying everything to a editor and saving from there.
    Everytime this happens I repeat to myself "I want an espruino-mode for emacs and one of these days I'm going to write it" ;)

  • This needs to be fixed in file.js.
    Filewriter used there does not change size of existing file.

    //writer.write(new Blob([convertToOS(data)], { type: "text/plain" })); old code
            var bb = new Blob([convertToOS(data)],{ type: "text/plain"} ));
            setTimeout(function(evt){ //make sure, truncate is done before writing
              fileWriter.seek(0);     //needed only in special cases
  • OK, good to know I am not the only one.

    Hopefully it will get fixed soon.

  • @JumJum - thanks! I'd been wondering what it could be...

    Is that code part of something else? Should fileWriter -> writer?

    It seems like there should be a better way to write a file than using an arbitrary timeout though :(

  • Oh, sorry
    fileWriter should be writer.
    It's a copy/paste from plugin project.
    Timeout was the most stable version, at least in my tests.
    Without it, I had a problem 2 or 3 times.
    Since the change to timeout, no problem came up anymore.
    May be, handling of USB sticks is different to hard disc (?)

  • I didn't even realize the WebIDE had a save feature - just the seemingly perverse autosave, which brings it back up with the right pane containing either the code you had in it last time, or the code that it started up with last time, whichever is less relevant to what you're doing now.

    I've always just copy/pasted to/from sublime text, which provides an, er, sublime interface for editing text files (it's also 70 fucking dollars for a glorified notepad)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

WebIDE Save Issue

Posted by Avatar for user47955 @user47955