Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-7188

Overview/Activity for a PR shows incorrect surrounding context code when clicking to show more around a diff hunk that's near another hunk

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Medium
    • None
    • None
    • Pull Requests
    • None

    Description

      On v3.8.0-m5 on https://stash.atlassian.com/ :

      I have a PR open. There's a comment on a line in a file, which someone made on the current version in the diff view.

      Given: My diff hunk with the comment on it has another diff hunk just above it in the file

      When: I view the comment in the Overview / Activity stream, and click the zigzag line above the fragment to show more surrounding context lines

      Then: I get different results from looking at the same section of code in the Diff view.

      (It's definitely the same comment in both views - comment ID 170183; and the comment was made on the current version.)

      • Screen Shot - unified diff, and Screen Shot - side-by-side diff: - these show the actual change and comment correctly. Note there are more hunks of changes right above the hunk that contains the review comment - e.g. notice the TODO CRA-549 comment.
      • Screen Shot - Activity view - shows the single diff hunk containing the comment. This is probably OK.
      • Screen Shot - Activity view expanded - after clicking the zigzag lines to expand the surrounding context. It's showing the original pre-PR code above the diff hunk. I think this is wrong, and very misleading - it doesn't match the current version of the code; it looks as if the hunk is being shown in context, but there's actually another change in this PR affecting those lines, as shown in the diff view, and it's not visible in Activity. E.g. notice the lines with the TODO CRA-549 comment are not visible, etc.

      Since I can directly respond to comments in Activity view, it's really important that Activity view's surrounding context should show the current version of the code, i.e. it should show any other hunks affecting those lines. Otherwise I may be making decisions based on incorrect information.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nclarke@atlassian.com Nick Clarke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: