Can you be a little more specific?
Yes, sure.
Original code (Mailer.services.js from SOGo 5.1.0):
d.prototype.init = function(e) {
(angular.isUndefined(this.uidsMap) || e.headers) && (this.$isLoading = !0, this.$messages = [], this.uidsMap = {}), angular.extend(this, e), this.path && (this.id = this.$id(), this.$acl = new d.$$Acl("Mail/" + this.id), this.threaded && (this.$collapsedThreads = [], d.$Preferences.settings.Mail.threadsCollapsed && d.$Preferences.settings.Mail.threadsCollapsed["/" + this.id] && (this.$collapsedThreads = d.$Preferences.settings.Mail.threadsCollapsed["/" + this.id]))), this.$displayName = this.name, this.type && (this.$isEditable = this.isEditable(), this.$isSpecial = !0, "inbox" == this.type ? (this.$displayName = l("InboxFolderName"), this.$icon = "inbox") : "draft" == this.type ? (this.$displayName = l("DraftsFolderName"), this.$icon = "drafts") : "sent" == this.type ? (this.$displayName = l("SentFolderName"), this.$icon = "send") : "trash" == this.type ? (this.$displayName = l("TrashFolderName"), this.$icon = "delete") : "junk" == this.type ? (this.$displayName = l("JunkFolderName"), this.$icon = "thumb_down") : "additional" == this.type ? this.$icon = "folder_shared" : (this.$isSpecial = !1, this.$icon = "folder")), this.$isNoInferiors = this.isNoInferiors(), angular.isUndefined(this.$shadowData) && (this.$shadowData = this.$omit())
}, d.prototype.selectFolder = function() {
d.$virtualMode || (d.selectedFolder = this)
}, d.prototype.getLength = function() {
var n = !1;
return _.filter(this.$messages, function(e, t) {
return e.first ? n = e.collapsed : e.level < 0 && (n = !1), e.first || !1 === n
}).length
}, d.prototype.getItemAtIndex = function(e) {
var t, n = !1,
s = _.filter(this.$messages, function(e, t) {
return e.first ? n = e.collapsed : e.level < 0 && (n = !1), e.first || !1 === n
});
return 0 <= e && e < s.length && (t = s[e], this.$lastVisibleIndex = Math.max(0, e - 3), this.$loadMessage(t.uid)) ? t : null
modified code (taken from ver. 4.0.4):
d.prototype.init = function(e) {
(angular.isUndefined(this.uidsMap) || e.headers) && (this.$isLoading = !0, this.$messages = [], this.uidsMap = {}), angular.extend(this, e), this.path && (this.id = this.$id(), this.$acl = new d.$$Acl("Mail/" + this.id)), this.$displayName = this.name, this.type && (this.$isEditable = this.isEditable(), this.$isSpecial = !0, "inbox" == this.type ? (this.$displayName = l("InboxFolderName"), this.$icon = "inbox") : "draft" == this.type ? (this.$displayName = l("DraftsFolderName"), this.$icon = "drafts") : "sent" == this.type ? (this.$displayName = l("SentFolderName"), this.$icon = "send") : "trash" == this.type ? (this.$displayName = l("TrashFolderName"), this.$icon = "delete") : "junk" == this.type ? (this.$displayName = l("JunkFolderName"), this.$icon = "thumb_down") : "additional" == this.type ? this.$icon = "folder_shared" : (this.$isSpecial = !1, this.$icon = "folder_open")), this.$isNoInferiors = this.isNoInferiors(), angular.isUndefined(this.$shadowData) && (this.$shadowData = this.$omit())
}, d.prototype.selectFolder = function() {
d.$virtualMode || (d.selectedFolder = this)
}, d.prototype.getLength = function() {
return this.$messages.length
}, d.prototype.getItemAtIndex = function(e) {
var t;
return 0 <= e && e < this.$messages.length && (t = this.$messages[e], this.$lastVisibleIndex = Math.max(0, e - 3), this.$loadMessage(t.uid)) ? t : null
I am not able to explain it more deeply, it was a matter of comparsion of differences in the file between versions 4.0.4, 4.0.8 (which was the first I noticed the problem earlier) and 5.1.0 and then some intuitive guess what could influence the unwanted behaviour. After several trials and errors I’ve come to this. As for now, I don’t observe any negative side effects of this modification.