Bug 320570 - TextChannelProxyWatcher cannot recover existing channels correctly
Summary: TextChannelProxyWatcher cannot recover existing channels correctly
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: common-internals (show other bugs)
Version: git-latest
Platform: Other Linux
: NOR normal
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-01 13:56 UTC by David Edmundson
Modified: 2014-04-12 12:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2013-06-01 13:56:57 UTC
When the contact list (or any other app using TextChannelProxyWatcher) starts, the TextChannelProxyWatcher tries to recover any existing channels and update the model accordingly.

The second parameter to AbstractClientObserver  does this, and observeChannels is called for each existing channel.

The TextChannelProxyWatcher then tries to search the associated model of contacts to find which contact this channel belongs to. However, we enter a race condition that channels can recover before the model is loaded. As such it never finds the contact to associate the channel with.

There is no signal from the contactslistmodel to say when all contacts are loaded, so I do not know of a good way to solve this.
Comment 1 David Edmundson 2014-02-17 22:24:12 UTC
The libkpeople mode should have the ability to fix this, we will now have all contactIds and accountIDs loaded when the client observer loads. 

To reproduce:
 have someone message you (don't accept the message!)
 confirm you see an envelope in the contact list
 restart contact list
 we want to  still see an envelope flashing.


Right now it's broken because I try and match ContactPtr objects between the channel and the model, if instead we match contactIDs it /should/ work.
Comment 2 Martin Klapetek 2014-04-11 15:21:46 UTC
Git commit ea0b98887b07de0318a97dc2d04bb7691bac522a by Martin Klapetek.
Committed on 11/04/2014 at 15:21.
Pushed by mklapetek into branch 'master'.

Match contacts in watcher proxy by contact id instead of ContactPtr

M  +1    -1    KTp/Models/text-channel-watcher-proxy-model.cpp

http://commits.kde.org/telepathy-common-internals/ea0b98887b07de0318a97dc2d04bb7691bac522a
Comment 3 Martin Klapetek 2014-04-11 15:22:48 UTC
Git commit 7e4aaf55d4834381dc1e272e953302d7c78c5942 by Martin Klapetek.
Committed on 11/04/2014 at 15:22.
Pushed by mklapetek into branch 'master'.

Delay setting trackUnreadMessages only after we have the model init'd

Reviewed-by: David Edmundson

M  +0    -1    contact-list-widget.cpp
M  +2    -0    main-widget.cpp

http://commits.kde.org/telepathy-contact-list/7e4aaf55d4834381dc1e272e953302d7c78c5942
Comment 4 Martin Klapetek 2014-04-12 12:40:02 UTC
Git commit 265a352a1832f920950777e75400f6f1fbf7e72b by Martin Klapetek.
Committed on 11/04/2014 at 15:21.
Pushed by mklapetek into branch 'kde-telepathy-0.8'.

Match contacts in watcher proxy by contact id instead of ContactPtr

M  +1    -1    KTp/Models/text-channel-watcher-proxy-model.cpp

http://commits.kde.org/telepathy-common-internals/265a352a1832f920950777e75400f6f1fbf7e72b