Skip to content

[SMS App] Add interface for querying a range of messages

Summary

This patch adds an interface to return only a specified window of messages.

The current implementation of the conversation interface loads all messages every time the conversation is requested. This is might be painfully slow to load in case the conversation is large or if there are a lot of MMS/RCS messages in the conversation (since those are wildly slower to load than SMS)

Used by https://invent.kde.org/kde/kdeconnect-kde/merge_requests/203 to enable Desktop functionality

Test Plan

  • With new Android app and old Desktop app:
    • The Android app will notice the missing fields and query for all messages as before.
  • With old Android app and new Desktop app:
    • The desktop will send fields for the new interface which will not be read and all messages will be returned.
  • With new Android app and new Desktop app:
    • The new interface is used and returns only a certain number of messages at a time.

Known Issues

There is an un-covered corner case if lots of MMS messages are received in the same second (or SMS messages in the same millisecond): Since the interfaces uses timestamps as a filter, it might happen that not all messages sharing the same timestamp are returned. The fact that there are still more messages sharing the timestamp is invisible to the caller. This could be a real-world problem if, for example, a user gets off a plane and their phone downloads a bunch of MMS all at once.

Edited by Simon Redman

Merge request reports