Skip to content

MR pending comments doesn't always load the review comment and file

Summary

Reproduced on GitLab 16.3 and reproduced on GitLab.com

When viewing a merge request and selecting a Pending comment in the dropdown, sometimes the file does not load in the Changes view.

Steps to reproduce

  1. Create a merge request with some new files (in my example, I created 4 files)
  2. Ensure that Show one file at a time is checked in the Changes view
  3. In each file, create a review comment so we populate the Pending comments dropdown
  4. Reload the page
  5. Use the Pending comments dropdown to select a review comment. The first one will normally load, but the others won't load the file at all.

See video - the last 2 files don't load when selected:

445331

Example Project

anton-bugs/445331-review-comments-not-loading!1 (closed)

What is the current bug behavior?

The Pending comments dropdown doesn't load the review comment on the file selected.

What is the expected correct behavior?

The Pending comments dropdown should load the review comment on the file selected.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Workaround

If you click on each of the files in the Changes tab on the left, and then click through the Pending Comments dropdown, the review comments load as expected.

Based on that observation alone, it seems there must be some expectation in the code that the file is already cached before you view a review comment.

Possible fixes

Edited by Anton Smith