Creating a suggestion immediately after pushing a change above it causes the suggestion to point the wrong line number

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 6.6.0
    • None
    • Severity 3 - Minor

      This appears to be a race condition when creating suggestions on a PR that is being rescoped (or has already rescoped but the user hasn't refreshed their page yet). This bug is present for all comments, not just suggestions, but the issue is most visible as the suggestion is now completely wrong.

      Issue Summary

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create a pull request, and open up the PR diff page
      2. Push a commit to the PR source branch that inserts one or more lines at the top of the file
      3. Without refreshing the PR diff page, create a suggestion on an ADDED line below the lines you just added somewhere on the pull request
      4. Refresh the page

      Expected Results

      I'm not entirely sure what should be expected here. If the comment is submitted mid-rescope, maybe Bitbucket should reject the request (and ask you to refresh). Maybe after the front-end is aware of the rescope, you shouldn't be allowed to make comments in the UI (and again ask for a refresh).

      Actual Results

      The comment is created successfully, but on page refresh the suggestion will be pointing to a line number ABOVE the line you originally selected (as many lines up as lines you pushed).

       

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Unassigned
              Reporter:
              Martin Henschke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: