[Pidgin] #15438: Sorting by status is unstable

Pidgin trac at pidgin.im
Mon Dec 24 05:24:49 EST 2012


#15438: Sorting by status is unstable
---------------------+--------------------------
 Reporter:  immerrr  |      Owner:
     Type:  defect   |     Status:  new
Milestone:           |  Component:  pidgin (gtk)
  Version:  2.10.6   |   Keywords:
---------------------+--------------------------
 This issue has been there since I've started using Pidgin @ 2.4.smth.
 Here's how it goes:

 * set "Buddies" -> "Sort Buddies" -> "By status"
 * try skimming through the list by pressing and holding <down> key
 * sometimes if there are 3+ away or invisible contacts in a row, as the
 selection passes to the next item, the item itself goes 1-2 steps back
 * on the next iteration, same thing happens and if you hold the key long
 enough, you see the pattern: the selection effectively stays in place and
 three items revolve around it instead.

 I've done some research and it appears that
 status.c:1600:purple_presence_compare is the reason. I've injected debug
 trace into gtkblist.c:7763:sort_method_status to log the swaps being made
 on buddy update and here's an excerpt from my log:

 (13:52:17) swap(ng, sl): presence_cmp 0 name_cmp -5
 (13:52:17) swap(is, ng): presence_cmp 0 name_cmp -5
 (13:52:17) swap(sl, is): presence_cmp -1 name_cmp 10

 (13:52:17) swap(ng, sl): presence_cmp 0 name_cmp -5
 (13:52:17) swap(is, ng): presence_cmp 0 name_cmp -5
 (13:52:17) swap(sl, is): presence_cmp -1 name_cmp 10

 So, '''ng''' swaps with '''sl''' which swaps with '''is''' which swaps
 with '''ng''' and so on, that's the revolving observed. And, obviously,
 this is caused by presence_cmp whose equivalency relation is not
 transitive.

-- 
Ticket URL: <https://developer.pidgin.im/ticket/15438>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list