Skip to content

Web IDE uses the wrong parent when the file changes during editing

Steps to reproduce:

  1. Create a file.
  2. Open it in the web IDE.
  3. Make a change but don't commit it.
  4. Elsewhere, make a change to a different part of the file, on the same branch.
  5. Commit the change in the web IDE to a new branch.

Expected: the parent commit for the web IDE commit is the one from step 2.

Actual: it's from step 4. And that means that I've overwritten someone else's changes unintentionally. This happens a lot on our team.yml file in www-gitlab-com.

Here's an example commit showing that: issue-reproduce/web-edit-tests@44c62fbf

I started editing with the parent of issue-reproduce/web-edit-tests@2e097c29, not issue-reproduce/web-edit-tests@ddc276d1.

The web editor has the same issue, but it does show a flash message if the parent SHA changes. Unfortunately, that message is very easy to ignore:

image

Edited by Pedro Moreira da Silva