You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import a .json backup with thousands of messages (example with 3000 messages, generated using the code at the end).
Expected behavior
The import should either complete quickly or display proper progress indication (for example as a notification). Related: #120 (request for progress dialogs across all apps).
Actual behavior
There is a toast saying "Importing...", and then it disappears and it seems like nothing is happening. A long time later (possibly several minutes) there is a toast saying "Importing successful". This is unacceptable, because the user has no idea what's going on (whether the import is still running or whether it crashed).
Screenshots/Screen recordings
No response
Attempt to make import faster using bulkInsert()
I tried making the import faster by switching from ContentProvider.insert() to ContentProvider.bulkInsert() as well as some other improvements (branch "import-bulk", commit), however that doesn't help that much. It reduces the time by 36% on Android 8.1 (66 sec => 42 sec) and 60% on Android 14 (72 sec => 26 sec) in an emulator with the attached 3000-message example (tested using this commit, which adds debug toasts and logcat messages to allow calculating the duration from the timestamps). The patched version is super fast on messages that already exist, but that doesn't help during the initial import. I'm not sure if it's worth merging, because it's a little complicated for not-very-big gains and the error handling isn't great (if one message in a chunk fails, then the rest of the chunk is skipped).
I don't think we can make the import any faster than that, because almost all of the time is spent in the bulkInsert() call waiting for the Telephony provider, which is outside of our control. We'd have to file a bug report against Android and hope that Google makes the code faster.
So I guess we have to show a proper progress indicator (e.g. using a notification; or at the bare minimum show multiple toasts).
Prior art
It might be worth comparing to the SMS Import / Export app to check if they have any tricks to speed up the import (based on a quick skim it doesn't appear so, but I think it's still worth doing a quick benchmark).
Testing code
For testing, the following Python code can be used to generate a large backup:
Checklist
Affected app version
1.0.1
Affected Android/Custom ROM version
Android 8.1, Android 14
Affected device model
Moto G5 Plus, emulator
How did you install the app?
Built from source
Steps to reproduce the bug
Import a .json backup with thousands of messages (example with 3000 messages, generated using the code at the end).
Expected behavior
The import should either complete quickly or display proper progress indication (for example as a notification). Related: #120 (request for progress dialogs across all apps).
Actual behavior
There is a toast saying "Importing...", and then it disappears and it seems like nothing is happening. A long time later (possibly several minutes) there is a toast saying "Importing successful". This is unacceptable, because the user has no idea what's going on (whether the import is still running or whether it crashed).
Screenshots/Screen recordings
No response
Attempt to make import faster using
bulkInsert()
I tried making the import faster by switching from ContentProvider.insert() to ContentProvider.bulkInsert() as well as some other improvements (branch "import-bulk", commit), however that doesn't help that much. It reduces the time by 36% on Android 8.1 (66 sec => 42 sec) and 60% on Android 14 (72 sec => 26 sec) in an emulator with the attached 3000-message example (tested using this commit, which adds debug toasts and logcat messages to allow calculating the duration from the timestamps). The patched version is super fast on messages that already exist, but that doesn't help during the initial import. I'm not sure if it's worth merging, because it's a little complicated for not-very-big gains and the error handling isn't great (if one message in a chunk fails, then the rest of the chunk is skipped).
I don't think we can make the import any faster than that, because almost all of the time is spent in the bulkInsert() call waiting for the Telephony provider, which is outside of our control. We'd have to file a bug report against Android and hope that Google makes the code faster.
So I guess we have to show a proper progress indicator (e.g. using a notification; or at the bare minimum show multiple toasts).
Prior art
It might be worth comparing to the SMS Import / Export app to check if they have any tricks to speed up the import (based on a quick skim it doesn't appear so, but I think it's still worth doing a quick benchmark).
Testing code
For testing, the following Python code can be used to generate a large backup:
Credit
Originally reported by @Abcd1234-dot in #88 (comment).
The text was updated successfully, but these errors were encountered: