FossifyOrg / Phone

A handy phone call manager with phonebook, number blocking and multi-SIM support
https://www.fossify.org
GNU General Public License v3.0
408 stars 39 forks source link

Very populated call history causes the app to crash #208

Closed barbaMimmo closed 6 days ago

barbaMimmo commented 1 month ago

Checklist

Affected app version

1.2.0

Affected Android/Custom ROM version

Android 12 / LineageOS 18.1

Affected device model

Sony Xperia XZ3 (akatsuki)

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

Choose "show call history" as the preferred layout in the app settings. Open the app from its icon in the home of your device. The app crashes instantly, or briefly shows some items in the call history and then crashes. A message by the OS appears: "the app continues to crash: do you want to close it?" (I don't know the exact terms, since my localization language is Italian, but it's the standard message for apps unable to be started correctly). Allow the OS to stop the app: no change. Manually kill the app and restart it: no change. Clean app's cache: still nothing changes.

A simple workaround exists: from OS's settings, apps , Fossify Phone app's details, access "more in-app settings", choose to open any other layout than "call history" when app starts, e.g.: "contacts". Home, open the app form its icon, the app opens correctly, let's switch to call history (but don't browse it, otherwise the app crashes again), go to the three dots, tap "clean call history". Now the call history empties, and the issue is solved. My device had 1043 entries in the call history before the problem arose!

Expected behavior

Make sure you have a very long call history (I mean very populated). Open the app from home. Browse the call history. You must be able to browse it thoroughly without issues. IMHO: The app should automatically clean the older call history entries before consuming so much memory that it gets killed or it crashes.

Actual behavior

Make sure you have a very long call history (I mean very populated). Open the app from home. Switch to show the call history. As soon as you browse it, the app crashes and the OS produces the usual message for crashes.

Alternatively: Open the app from home (the setting "show call history first" is already selected). The app crashes immediately (or after a few seconds, or as soon as you browse the call history), and the OS produces the usual message for crashes.

Screenshots/Screen recordings

No response

Additional information

Calling a number from a "callto" link still works when the described issue is present, because it does not open the call history, only opening the main layout of the app where the call history is shown causes the crash.

Note that I never manually cleaned the call history feom within the app or elsewhere before.

Note that my device is currently quite low on memory, but there are no system message related to it yet, and every other app still works perfectly.

I have no other telephone app but the stock one, and only Fossify Phone is the preferred, with all permission granted and no automatic permission removal.

Please note: now that I've cleaned the app history, I can't reproduce the bug anymore, since the app works again flawlessly.

Many thanks and sincere compliments to all the FossifyOrg team! Keep up the good work!

Saarsk commented 1 month ago

Not sure if related, but I was able to crash it by selecting too many list items and trying to delete.

(This was on Android 11 (reason being it was a temporary borrowed phone), so I deleted the log prior to when I started using it but had also populated the log myself at that point.)

I think I selected between 200 and 300 log items. The call log spanned back about 2 years, if the recency matters.


Also, I don't think the app should automatically delete old log history by default. There has been times where going back several years to recall dates or calls have saved tricky situations.

If that feature is added, it should have options and be off by default.


(There is (usually) a limit in Android of call log items. I think it applies only to the system app in AOSP unless changed by OS developer (or user via mods). The limit is 500 prior to API 30 (Android 11) and 1000 after API 30. That limit might not apply to Fossify's app (and I believe there should be no limit, but wouldn't oppose a clean-up reminder if the cache gets very slow).)

s676p commented 1 week ago

Just discovered a similar problem trying to migrate my call list from SMT to Fossify Dialer. Very long call history ( 483 entries ) . I exported in SMT and tried to read it in Dialer and an error message flashed by about invalid format and the call list has less than 100 entriesnow. Interestingly enough reading the same call list back into SMT produces the same error. Dumping the .json file with jq shown nothing out of the ordinary - can't see anything weird where it is cut off. Daily Smsbackup .xml files look fine and show a cutoff around 500 ( oldest calls deleted whenever new ones are made ). The app does not crash though . It merely refuses to restore the complete list

peter

s676p commented 1 week ago

Took a look at the code in RecentHelpers and found this

class RecentsHelper(private val context: Context) { companion object { private const val COMPARABLE_PHONE_NUMBER_LENGTH = 9 const val QUERY_LIMIT = 100 <<<<<<<<<<<<<< }

naveensingh commented 1 week ago

I think the crash is related to formatting phone numbers. Those who are facing this issue may try disabling "Format phone numbers" as a workaround.

naveensingh commented 6 days ago

Should be fixed in the next update

naveensingh commented 6 days ago

Here's an APK signed with official keys for those who want to test it out:

phone-4-foss-release.zip

To install, you'll have to rename the file to phone.apk because Github doesn't support APKs. Thanks!