Bug 269774 - Does not check whether sendMessage was successful
Summary: Does not check whether sendMessage was successful
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: text-ui (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR major
Target Milestone: 0.4.0
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 17:39 UTC by David Edmundson
Modified: 2012-07-06 12:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Check for delivery reports (not-so-pretty patch) (3.80 KB, patch)
2011-04-16 05:30 UTC, Lasse Liehu
Details

Note You need to log in before you can comment on or make changes to this bug.
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.