signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.67k stars 6.17k forks source link

Android-reported "User data" almost twice as large as Signal's "Storage usage" #13758

Open sbraz opened 3 weeks ago

sbraz commented 3 weeks ago

Guidelines

Bug description

Hello, Signal currently reports about 40 GiB under "Storage usage":

However, Android shows that it actually uses 71 GiB, that's almost twice as much:

I understand that part of the issue could be that Signal's data was copied from another phone and I am hitting #11509 so I started with a huge amount of space used. However, even after removing a lot of large duplicate files and seeing Signal's "Storage usage" greatly reduced, Android still shows that it is using way too much space.

This problem looks very much like #9634 which was resolved a long time ago, could they be similar?

Screenshots

Embedded above.

Device

Pixel 8a

Android version

14

Signal version

7.20.2

Link to debug log

https://debuglogs.org/android/7.20.2/a16ce2e5f411bcba4ed3e73163933818985d0ee0f661c0b596d80609af0de543

mosbat commented 2 weeks ago

@sbraz

After reviewing the source code, there is a difference between what Signal includes in the calculation vs. what Android includes in the calculation of the size.

Signal, calculates the sizes of attachments primarily while Android calculates much more such as cache and even outdated files from previous installations.

As evidence, if you uninstall the app and reinstall it, the size will be less including attachments.

Now, we could however, add a tip or hint/text somewhere to clarify that as indeed this can be confusing from end-user's perspective.

sbraz commented 2 weeks ago

As evidence, if you uninstall the app and reinstall it, the size will be less including attachments.

I might have missed something but I uninstalled the app, reinstalled it and I lost all data. Is Android usually supposed to keep data when apps are uninstalled?

mosbat commented 2 weeks ago

As evidence, if you uninstall the app and reinstall it, the size will be less including attachments.

I might have missed something but I uninstalled the app, reinstalled it and I lost all data. Is Android usually supposed to keep data when apps are uninstalled?

No, usually, everything is wiped when an app is removed unless the app enables you to download something into a different directory.

I meant if you re-install the app assuming you got the same attachments downloaded again, the app size will be lesser than if you had the app on your phone for a very long period of time, accumulating updates and such.

sbraz commented 2 weeks ago

I meant if you re-install the app assuming you got the same attachments downloaded again

I don't understand how one could do this however since uninstalling the app deleted all data?

if you had the app on your phone for a very long period of time

I've had it for a few days, I transferred data from another phone. Do you mean that deleting attachments from "storage usage" doesn't have the desired effect?