Bug 45755 - Inconsistent ordering of pendingMessageRemoved
Summary: Inconsistent ordering of pendingMessageRemoved
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-qt (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Dario Freddi
QA Contact: Telepathy bugs list
URL:
Whiteboard: r+
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 16:19 UTC by David Edmundson
Modified: 2012-03-13 06:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch for issue. (704 bytes, patch)
2012-02-21 15:51 UTC, David Edmundson
Details | Splinter Review

Description David Edmundson 2012-02-07 16:19:39 UTC
Assuming we have one message in the messageQueue

If we call forget() TpQt emits pendingMessagesRemoved after it deletes it from the queue, so messageQueue.size() is 0.

If we call acknowledge and removed in another client TpQt emits pendingMessagesRemoved before it deletes it from the queue, so messageQueue.size() is 1. (in  TextChannel::Private::processMessageQueue())

From a personal POV it makes a lot more sense to me to delete it from the message queue first, in all my use cases of this signal it's used to update any notification of unread messages, on receipt of this signal I end up call messageQueue.size() which gives me +1 of what the message size will be by the time this signal finishes.

Given the signal is called pendingMessageRemoved (emphasis on it being a past tense) I would have expected the removal to have already taken place.
Comment 1 David Edmundson 2012-02-21 15:51:11 UTC
Created attachment 57428 [details] [review]
Patch for issue.

Emit pendingMessagesRemoved after the pending message has actually been removed.
Comment 2 Dario Freddi 2012-03-13 03:44:52 UTC
Under review
Comment 3 Dario Freddi 2012-03-13 05:59:50 UTC
Approved
Comment 4 Dario Freddi 2012-03-13 06:31:48 UTC
Committed as 5b2c18f732b512e539a3bf69c21420d719a20e0a, will be released in 0.9.1, thanks for your patch :)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.