Deleting app does not delete (user) data

This is a good resource: https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s05s03.html

1 Like

Maybe there should be and option whether you want to delete or keep the user data?

2 Likes

Or simple information where these data are, so the user can delete them manually as devel-su if wanted.

1 Like

RPM %preun or %postun scripts can (and IMO should) be used for that. Just don’t forget the if [ "$1" == 0 ] check ($1 is 1 on upgrade). That’s forbidden in Jolla Store though :confused:

3 Likes

This is an important thing we devs have to start think about.

IMO a system package manager like rpm should not touch any data inside the user directory. This also became more difficult with multi user support.

I would prefer a “clear config” button inside the app itself, which also gives you feedback what is about to be deleted.

2 Likes

It’s not RPM, it’s your script who does the cleaning. RPM itself doesn’t touch anything that’s not related to package management. With multiple users it’s pretty much the only place where it can be done, actually. Apps have no access to other user’s data, but scripts which are run by RPM with root privileges, do.

But how can the user decide whether or not to delete data?

Good point :confused: There’s no simple solution, it seems.

Maybe this helps? :

Uninstall packages with configuration files

Debian : dpkg --purge PaketName
Debian : apt-get purge PaketName
Debian : aptitude purge PaketName
Red Hat/CentOS : yum remove
Gentoo : ?
Zypper : zypper remove [12)]

[12)]Complete cleaning of the configuration only manually:

for package in package1 package2 package3
do
  echo "removing config files for $package"
  for file in $(rpm -q --configfiles $package)
  do
    echo "  removing $file"
    rm -f $file
  done
  rpm -e $package
done

Edit: This is a generic suggestion.

1 Like

You mean like?
https://together.jolla.com/question/229207/zypper-remove-packages-including-configs-apt-purge/

Oh, surprise! Seems like an old problem.

This does never delete any user data & configuration! I only deletes system configuration/data (See also my other post here Deleting app does not delete (user) data)

1 Like

Sure you are right. There is only one safe way to let developers clear the configuration files. Otherwise you have to search in /etc, /home, /opt and elsewhere yourself.

The suggestion from the internet is unsuccessful. My uninstallation experiences with “synaptic” on a Debian system rarely work. It’s just theory. I gave up looking for a solution a long time ago.

so we are talking a that this is a huge problem of Linux, where we cant delete the data so it can be track ?
why android can do it then when it is a linux kernel?

Not the Linux Kernel is the problem, but the packaging of the Apps. While Sailfish uses RPM (but it would be the same with AUR, deb, etc), Android uses a completely different concept for apps.

1 Like

ookay!! hope that that will change it is important that we like users have the control of what we need to delete and what we wanna keep, and it has to be in a easy way, where you dont need to be master IT class for doing it.

1 Like

I don’t know of any operating system that fulfills this requirement. We can only remind the developers to delete all data when uninstalling.

In Android this would be clear cache and clear userdata in settings -> Apps -> [appname] -> Storage.

EDIT: What I think of: Jolla should provide a coding guide for this task, roughly like:

  • “put the config here”
  • “put the cache there”
  • provide a qml plugin and sample code, which deletes these files/dirs.
  • provide a design principle, where to put the buttons for triggering the deletion.

…this could also obviously be used to reset an app.

1 Like

There is a standard which governs this (the XDG, X Desktop Guidelines at https://specifications.freedesktop.org), and Jolla has some guidelines in that regard.

The two paths you mention would be ~/.config/harbour-foo, and ~/.cache/harbour-foo, and then there is ~/.local which has some different semantics (it basically works like /usr or /usr/local but for the user).

There is also

which allow developers convenient handling of these standard locations.

If apps follow that (and even if they don’t), they are free to provide an option inside the app to remove whatever they create.

As has been mentioned, it is not the domain of a package manager to delete these kinds of data, package managers should not do this and what some here request would be Very Bad Practice.

Now, one could argue that there should be an OS function or App to clean out these locations, similar to the mentioned Android functionality, but I for one am strictly against this happening automatically.
I like that my settings and other data persist between me installing and uninstalling apps, and if I really want everything gone I can use the factory reset, or manually delete things.

But even such an application would rely on the individual developers adhering to the aforementioned standards (or really, any other as long as it’s the same), and currently there is little which forces one to do so.

7 Likes

One can’t stress this enough. It’s strange coming up with such ideas.

I don’t think this is possible in SailfishOS in it’s current state. I just mentioned Android as an answer to the statement of the posting before.

I agree with everything you wrote. Just two things to add:

  • You can’t delete files from qml-only -> hence a plugin may be needed.
  • Jolla should mention this in coding guides like they write aboout things like using CamelCase… “You should provide a function to the user deleting app generated data.” followed by best practice.
2 Likes