Inconsistent maximum hierarchy size when creating/adding child Epics

Summary

It's not possible to add another epic to an epic that has four ancestors. However, it is possible to create one and produce a hierarchy of size 6.

Steps to reproduce

  1. Create an epic hierarchy of size 5
  2. Visit the epic at the bottom of the hierarchy
  3. Attempt to add another epic as a sub-epic, see a 409 status code and error message
  4. Click the carat and select 'Create and Epic' from the dropdown
  5. Click 'Create an Epic', enter a name in the input and click 'Create'

Example Project

Test in gdk

What is the current bug behavior?

A hierarchy of size 6 is created.

What is the expected correct behavior?

Attempt to create epic should fail, with appropriate error message.

Possible fixes

Edited by John Hope