When loading via Ajax arrays of entries, feeds or folders from the server, a shallow copy of the array is made before operating on it.

This is intended to fix a bug in which, when the user had enabled the "open all entries by default" configuration flag, if the user clicked on an open entry it disappeared; the expected behavior is that the entry closes. The root cause was that different variables in the root scope pointed to the same array; in particular, $rootScope.entries and $rootScope.open_entries pointed to the same array of entries. When an entry was closed, it was removed from the open_entries array; but this had the unintended side effect of also removing it from the $rootScope.entries array, which made it disappear from the view.

The fix is to make a copy of the arrays retrieved via Ajax before passing them to other methods which store them in $rootScope variables. This way, $rootScope.entries and $rootScope.open_entries are different arrays (even if the copy is shallow and the entry object themselves are the same) and removing and entry from one of them does not alter the other one.

The bug affected only the above mentioned entries and open_entries arrays, but the fix has also been applied to the feeds and folders arrays in the root scope, as a matter of good practice.