[SMS App] Make sms app not crash when conversation is selected with no devices connected
ClosedPublic

Authored by sredman on Dec 16 2018, 8:22 PM.

Details

Summary

This patch fixes T10184 and stops the SMS app from crashing when a conversation is selected but no devices are connected. It also allows the SMS app to access the cached messages in the ConversationsDbusInterface so the app is still slightly useful even when the device is disconnected.

Test Plan
  • Open sms app
  • Open a few conversations
  • Disconnect phone (Force close app?)
  • Re-open a conversation which was previously opened
    • Verify that the messages appear. It is possible to scroll up to view any older cached messages too!
  • Open a conversation which was not opened previously
    • Verify that a single messages is shown (since this was the only one in cache, from populating the list of all conversations)
    • Verify that attempting to scroll this conversation does nothing, but also does not crash the app

Note: Opening the app with no phone connected will cause it to lose its handle on the deviceId, so it can't spawn a new Dbus interface, so it will remain blank and empty. Solving that is a project for another day.

Diff Detail

Repository
R224 KDE Connect
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sredman created this revision.Dec 16 2018, 8:22 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptDec 16 2018, 8:22 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
sredman requested review of this revision.Dec 16 2018, 8:22 PM

I can confirm that it doesn't crash when I unpair my device, but now there's the "No device" warning and the conversation list visible simultaneously

I can confirm that it doesn't crash when I unpair my device, but now there's the "No device" warning and the conversation list visible simultaneously

Check out D17616

My idea is to allow access to the data which is still cached in the ConversationsDbusInterface even after the phone is disconnected. There is some room for improvement in how this is implemented, but the current implementation works pretty well.

apol accepted this revision as: KDE Connect.Jan 22 2019, 1:47 AM
apol added a subscriber: apol.

let's see how it goes

This revision was not accepted when it landed; it landed in state Needs Review.Jan 23 2019, 1:58 AM
This revision was automatically updated to reflect the committed changes.