Comment 9 for bug 1017463

Revision history for this message
In , Xavier Claessens (zdra) wrote :

Found the root cause! It hit g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); in empathy_tp_chat_new(). In that case indeed NULL channel is returned and no error is provided.

This is because tp_connection_get_account() returns NULL because the TpAccount does not know its Connection yet. This is because in HandleChannels we create both TpAccount and TpConnection objects but we need to wait for TpAccount to prepare CORE before it calls _tp_connection_set_account().

This crash does not happen when empathy-chat is already started because empathy-chat loads a full Folks aggregator, so it has the time to prepare CORE on all TpAccount before HandleChannel happens.

I think TpBaseClient should prepare TpAccount and TpConnection before creating the TpChannel. I think it is reasonable to consider that TpChannel's constructor assert that its TpConnection is already prepared (atm it doesn't, TpChannel even prepare CORE on its connection as part of TpChannel's CORE feature).