D16475: [SMS App] Make requestMoreMessages asynchronous, blocking, and caching

Simon Redman noreply at phabricator.kde.org
Mon Nov 12 16:58:47 GMT 2018


sredman added a comment.


  In D16475#358422 <https://phabricator.kde.org/D16475#358422>, @apol wrote:
  
  > I would be okay with accepting this patch. I wonder why it's better than the previous code though. It seems to be just doing the same but from another thread?
  
  
  By previous code, do you mean the earlier version of this patch or the stuff currently on the master branch?
  
  In case of comparing to the earlier version, it is basically the same, but no new threads have been created. The work in the constructor (even after `this->moveToThread(..)`) is all done on the main thread. Future signals delivered to the Worker object are handled on the new thread.
  
  In case of comparing to the master branch, the new thread is doing the same work, but it also blocks (in ConversationsDbusInterface::updateConversation) while it waits for messages to be delivered from the remote device. The alternatives to blocking are:
  
  - Return immediately, only using the messages currently cached. On the first try, this will be no messages, but the request will be delivered to the phone and handled. If the user of the SMS app waits until that request is handled and tries to load messages again, there will be cached messages the second try. This is not a very nice user experience.
  - Return immediately, only using the messages currently cached. On the first try, this will be no messages. As the phone replies with its messages, immediately announce them on dbus. The first time the user opens a conversation in the messaging app, every message in the conversation will be shown (after a quick delay). When opening future times, the cache will be populated, so only the requested messages will be shown. This is also kind of ugly.

REPOSITORY
  R224 KDE Connect

REVISION DETAIL
  https://phabricator.kde.org/D16475

To: sredman, #kde_connect
Cc: apol, nicolasfella, kdeconnect, shivanshukantprasad, skymoore, wistak, dvalencia, rmenezes, julioc, Leptopoda, timothyc, jdvr, Danial0_0, johnq, Pitel, adeen-s, SemperPeritus, daniel.z.tg, jeanv, seebauer, bugzy, MayeulC, menasshock, mikesomov, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20181112/a5928557/attachment-0001.html>


More information about the KDEConnect mailing list