| Summary: | File is mangled on save | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Boris Kozorovitzky <majorzbzzn> | ||||||||
| Component: | Editor | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | gheorghe, john.arthorne, ken_walker, mamacdon, meloandroid0, xinyij | ||||||||
| Version: | 5.0 | Keywords: | triaged | ||||||||
| Target Milestone: | --- | Flags: | Silenio_Quarti:
review?
(john.arthorne) |
||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| See Also: |
https://git.eclipse.org/r/76023 https://git.eclipse.org/r/76025 https://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=5b18711889d728b737d3b1200d8f16fd3c906693 https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=894a9de9da5ffd62b701e17f6af7201e614da3c0 |
||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Sorry, incorrect severity Updated Importance Bogdan, this is happening on the node fileClient. It works fine for me in the orion fileClient. Boris originally reported this issue on IRC. I was able to reproduce it by accessing his server, which was running Orion Node. But I can reproduce this against orion.eclipse.org as well: * Import game.js using drag & drop in Orion navigator * Ensure auto save: ON, auto load: ON, save as diff: ON * Open game.js * Make some changes, save * Reload file. File is mangled. One possibly important thing to note is that game.js is UTF-8 encoded and begins with a BOM. The BOM is not included in the string on the client side, but it is on the server side awhile applying the diffs. Created attachment 240763 [details]
possible patch
This patch removes the BOM character before applying the changes to the file. It also changes the encoding used to read the file into memory to UTF-8.
John, please could you review this patch? There might be other places where we need to handle the BOM character. IOUtilities.toString(InputStream) for example. Another solution would be to use the wrapper BOMInputStream from Apache Common IO. I have a corresponding patch for Orion Node which I'll put in if John is OK with the approach taken. Created attachment 241101 [details]
Possible patch for node side
Hi, ¿This issue is not solved yet? I have Orion version 9.0 installed and have the same problem when save twig files (the template engine) of my project. If I switch off the Diff Save from the settings as suggested works well. Thanks I tried to reproduce this with Mark's steps in comment #4 and the game.js from Boris, and I cannot reproduce. It looks like this is already fixed. Please reopen or enter a new bug if there is still a problem. New Gerrit change created: https://git.eclipse.org/r/76023 New Gerrit change created: https://git.eclipse.org/r/76025 This is still happening. Gerrit change https://git.eclipse.org/r/76025 was merged to [master]. Commit: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=5b18711889d728b737d3b1200d8f16fd3c906693 Gerrit change https://git.eclipse.org/r/76023 was merged to [master]. Commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=894a9de9da5ffd62b701e17f6af7201e614da3c0 fixed *** Bug 496353 has been marked as a duplicate of this bug. *** |
Created attachment 240661 [details] The problematic file and the animated gif of the issue When saving a specific file, some of the characters don't get saved properly. I asked Mark and he suggested to switch off the Diff Save from the settings, it fixed the issue. I attach the affected file and a reproduction of the bug (animated gif)