CB-4890: fix edge and backport to 3.0, 3.1