Skip to content

Protect against some MR Diff Tree rendering failures based on some root folder name values

Thomas Randolph requested to merge tor/defect/diff-tree-names-fail into master

What does this MR do and why?

For #369220 (closed).

In some circumstances, the Diff File Tree may fail to render (and take the rest of the page with it) because it succeeds in getting the correct parent blob, but has unknowingly selected an object that is part of the standard JavaScript Object prototype chain.

This change simply checks that what was selected actually has a child property .tree, which is necessary for subsequent steps.

If it doesn't, we assume that what was selected is invalid and set it to null to short-circuit following steps.

Known Concerns

Please note that this fix is simply to enable the MR Diffs page for some affected users. It is not a perfect fix, for all unknown issues, but it should protect against a fairly wide array of issues.

#382550 is a follow-up issue to stem any other potential issues with this implementation, and to generally improve it.

Screenshots or screen recordings

Before After
mr-file-tree-names-before (Due to the defect causing a fatal error, this spinner is never replaced with a usable UI) mr-file-tree-names-after

How to set up and validate locally

  1. Apply this patch to your GDK
  2. Visit any MR Changes tab

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports