If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Duplicate items in the new conversation tab

RESOLVED FIXED in 1.5

Status

Instantbird
Conversation
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: nhnt11, Assigned: nhnt11)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
*** Original post on bio 2201 at 2013-10-03 22:21:00 UTC ***

This seems to be a regression caused by bug 955582 (bio 2143). I don't have reliable STR at the moment.
(Assignee)

Updated

4 years ago
Blocks: 955582
(Assignee)

Comment 1

4 years ago
Created attachment 8354698 [details] [diff] [review]
Patch

*** Original post on bio 2201 as attmnt 2927 at 2013-10-04 15:11:00 UTC ***

When a contact's status changed, it was getting removed and re-added. In the process, a new PossibleConvFromContact is created rather than modifying the existing one (which is removed). The old one was not getting removed from _convsWithUpdatedStats.

The result was that we were trying to splice a conv out of this._convs, which wasn't in the array in the first place - we were instead removing the last element in the array because indexOf returned -1. In addition, we re-added the old conv, resulting in a duplicate.

I hope looking at the code makes this easier to understand, else I'll try to explain it more clearly.

The patch adds a check in repositionConvsWithUpdatedStats to make sure we're only attempting to reposition a conv if it's still in the list. I've also taken this opportunity to ensure we don't add a conv twice to _convsWithUpdatedStats.
Attachment #8354698 - Flags: review?(aleth)
(Assignee)

Updated

4 years ago
Assignee: nobody → nhnt11
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
Created attachment 8354699 [details] [diff] [review]
Patch 2

*** Original post on bio 2201 as attmnt 2928 at 2013-10-04 21:00:00 UTC ***

Sets can't have duplicate elements, so we don't need the duplicate check. D'oh!
Attachment #8354699 - Flags: review?(benediktp)
(Assignee)

Comment 3

4 years ago
Comment on attachment 8354698 [details] [diff] [review]
Patch

*** Original change on bio 2201 attmnt 2927 at 2013-10-04 21:00:07 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8354698 - Attachment is obsolete: true
Attachment #8354698 - Flags: review?(aleth)
Comment on attachment 8354699 [details] [diff] [review]
Patch 2

*** Original change on bio 2201 attmnt 2928 at 2013-10-04 21:13:00 UTC ***

I can follow the idea what was wrong here and the fix looks to be consistent with that.

Note that the trigger of the bug is not a status change alone but a new message from a a contact followed by a status change of that contact.

Thanks for fixing that!
Attachment #8354699 - Flags: review?(benediktp) → review+
Whiteboard: [checkin-needed]
*** Original post on bio 2201 at 2013-10-04 22:01:04 UTC ***

http://hg.instantbird.org/instantbird/rev/e64e814681eb
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed]
Target Milestone: --- → 1.5
You need to log in before you can comment on or make changes to this bug.