Bug 269774

Summary: Does not check whether sendMessage was successful
Product: [Frameworks and Libraries] telepathy Reporter: David Edmundson <kde>
Component: text-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: major    
Priority: NOR    
Version: unspecified   
Target Milestone: 0.4.0   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Check for delivery reports (not-so-pretty patch)

Description David Edmundson 2011-03-30 17:39:35 UTC
Version:           unspecified
OS:                Linux

Line 528 of ChatWidget.cpp calls sendMessage() however we not check the PendingSendMessage() to see if the operations succeeded.

Reproducible: Always
Comment 1 Lasse Liehu 2011-04-14 17:11:25 UTC
The problem is wider than that. Just checking for errors from the Tp::PendingSendMessage returned by Tp::TextChannel::send isn't enough (though I guess we could want to check for that, too).

From #kde-telepathy, Mar 30 2011:
20:58 < oggis_> lliehu: actually TextChannel::sendMessage only fails if the message is somehow malformed or alike - you receive a special message 
which is the delivery report later on, linked by the token you get from the PendingSendMessage

I'm not sure if delivery reports are received by Tp::TextChannel::messageReceived, just with Tp::Message::messageType() returning Tp::ChannelTextMessageTypeDeliveryReport, as I haven't been able to receive a delivery report (haven't tried that hard, though).
Comment 2 Lasse Liehu 2011-04-16 05:30:44 UTC
Created attachment 59031 [details]
Check for delivery reports (not-so-pretty patch)

With this, an example "steps to reproduce" a delivery report:
1. Chat with someone on MSN using telepathy-haze.
2. block msn using iptables
3. send some messages and then wait
4. output on console:
telepathy-kde-text-ui(9956) ChatWidget::handleIncomingMessage: Received a delivery report!
telepathy-kde-text-ui(9956) ChatWidget::handleIncomingMessage: delivery failed temporarily
telepathy-kde-text-ui(9956) ChatWidget::handleIncomingMessage: Delivery report for message:  "" ; sent at QDateTime("")
telepathy-kde-text-ui(9956) ChatWidget::handleIncomingMessage: "Lasse" "Message could not be sent because an error with the switchboard occurred:"
Comment 3 David Edmundson 2011-12-29 20:12:56 UTC
We now catch message failed reports.
Resolved.