U4-11192 - Better fix for the syncTree error

Created by Sebastiaan Janssen 09 Apr 2018, 12:52:11 Updated by Nicholas Westby 26 Jun 2018, 22:42:27

Tags: Consider for sprint

Relates to: U4-11167

In http://issues.umbraco.org/issue/U4-11167 we're kind of hiding the actual issue, so now the tree doesn't sync sometimes when refreshing.

Quoting Shannon on the actual cause of the problem and possible fix:

• the problem is that mainTreeEventHandler.syncTree is null in the navigationService.syncTree method • navigation.controller.js -> navigationService.setupTreeEvents($scope.treeEventHandler); this is the call the wires up this weird jquery object (mainTreeEventHandler) that manages the tree in the navigationService, the timing of this call seems to be ok since this error occurs because mainTreeEventHandler.syncTree is null and in this case mainTreeEventHandler is not null • in umbree.directive.js in setupExternalEvents, the scope.eventhandler.syncTree (which is this jquery object) is assigned a value

So the problem is that setupExternalEvents is called too late, it needs to be eagerly called almost before anything happens in the back office to make sure this object is set.

Better solution would be to re-write how this is all put together :wink: but in the interim, eagerly calling this somehow will solve the problem. Then we should also remove the new check in the PR that does if (mainTreeEventHandler.syncTree) { since that will hide the problem if it happens again.

1 Attachments


Nicholas Westby 26 Jun 2018, 22:42:27

FYI, I still see this error when I refresh the page while viewing a content node in the back office over a very slow VPN connection:


I'm on Umbraco 7.11.1 (just upgrade this morning). The URL I'm refreshing is http://localhost:54314/umbraco#/content/content/edit/5135 (i.e., a content node).

I've deleted App_Data\TEMP and disabled by browser cache in Chrome (in the network tab, and I'm aware the developer console must be open for the disable cache setting to be respected).

Priority: Normal

Type: Bug

State: Open


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.11.1

Due in version:


Story Points:

Cycle: 10