Skip to content

Fix viewing some legacy diff notes in discussions

What does this MR do?

LegacyDiffNotes created by the GitHub importer lack details about the SHAs they referenced on the GitHub side. This exposes a bug in our diff viewer selection logic, where we inappropriately pick the image viewer whenever both old blob and new blob are nil.

In practice, the image diff viewer relies on both old and new blob to do its work, so this just leads to us being unable to render the diff.

Adding this condition allows us to fall back to the basic text diff, which is usually sufficient.

Screenshots (strongly suggested)

It works! \o/

Screenshot_from_2020-10-22_17-34-35

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #26952 (closed)

Edited by Nick Thomas

Merge request reports