mb0 / lab

golab: go local application builder - a web-based golang ide
BSD 2-Clause "Simplified" License
159 stars 16 forks source link

suspending computer can result in golab silently failing to update files #5

Open mpictor opened 11 years ago

mpictor commented 11 years ago

I tend to suspend my computer rather than shutting it off. I left golab open in my browser, and when I resumed I had to click the reconnect icon in the upper left. I edited a file that I had left open. It seemed to work - console output showed that packages were being rebuilt when I pressed ^s. However, behavior of the modified code did not change.

I didn't realize what the problem was until I opened the file in a text editor and found that the last changes were ones I made before putting my computer to sleep.


I think an error should be displayed to the user if any OT transform fails to apply.

mb0 commented 11 years ago

this seems to happen when the file was changed while the client was offline. however i think its not a failed transformation, but instead a naive reconnect implementation. reconnect must not only reconnect to the server but also to the document and update to the latest revision.

with a simple fix the client would replace the document with the latest version and loose offline editor changes. the reconnect should show a warning and ask for confirmation to minimize any problems. the editor should also switch to read-only mode if there is a disconnect. it would basically do the same as a browser refresh, without loosing the list of tabs.

a diff view would be better but also way too much work for now.