jlebon / textern

A Firefox add-on for editing text in your favourite external editor!
GNU General Public License v3.0
138 stars 21 forks source link

Reverted to old version of text after using Gitlab Comment "Preview" feature #13

Open inducer opened 6 years ago

inducer commented 6 years ago

I just lost about an hour of work through an interaction of textern with gitlab, where (I believe) after using Gitlab's "preview" mode, I was reverted an old version of my (lengthy) input. I don't quite recall the steps, but it's scary that textern

jlebon commented 6 years ago

Ouch, so sorry to hear that. :( I know how painful losing work is. Can you try to reproduce this and write down the steps? I couldn't get it to fail while playing around on Gitlab.

Re. deleting temporaries: all files are stored in a private tmpdir, which is deleted once the last editor instance is closed (in fact, Textern is not running at all if no editors are open). This ensures that tmp files don't accumulate on the host and more importantly that no potentially sensitive information is left on disk (see also https://github.com/jlebon/textern/issues/6).

I suppose we could define an alternative garbage collection policy, e.g. deleting on browser exit instead? Hmm, not sure. I'd like to flesh out the use case a bit more first.

inducer commented 6 years ago

Re. deleting temporaries: all files are stored in a private tmpdir, which is deleted once the last editor instance is closed (in fact, Textern is not running at all if no editors are open). This ensures that tmp files don't accumulate on the host and more importantly that no potentially sensitive information is left on disk (see also #6).

Understandable, though not my biggest concern on a single-user laptop.

inducer commented 6 years ago

Just happened again. This time without the use of the Preview feature. I think I saw the full text in the textarea briefly, but it looked like it disappeared as I clicked "submit".

TheZoq2 commented 5 years ago

For me, this seems completely reproducible using these steps:

  1. Create a new issue and enter a description
  2. Start editing using textern
  3. Don't type anything in the text area outside of textern
  4. Hit submit

This only the content of the textarea before starting extern is writen to the issue. Step 3 is important, if you add a single character to the description, everything is saved. To me it feels like the text area updates that textern is doing aren't triggering some important event in gitlab. Therefore, a workaround is to make a tiny modification to the text inside the browser before hitting submit.

jlebon commented 4 years ago

OK yup, I can reproduce this issue as well now. For me, the description textarea of a new Gitlab issue works fine. The problem seems to be commenting on an open issue (and I imagine open MRs too). If you seed the textarea with some text before starting Textern, then entering Textern, adding text there, and exiting the editor, and clicking Submit without typing into the textarea, the submitted text ends up being the version prior to starting Textern.

Could implement some Gitlab specific hack for this, though I'd rather something a bit more generic. Hmm, will play around a bit with solutions.

archenemies commented 4 years ago

I've also experienced the same problem with text being reverted. It may have been gitlab, I can't remember.